How can I install nmslib on Windows 10 - pip

I am trying to install scispacy with pip and found that the installatio of nmslib was causing issues. There are various posts on the internet as to how to fix this, but none seem to be working for me.
I am running Python 3.7.4 on a Windows 10 laptop
Pip is version 19.2.1
Here is error part of the logs
2019-08-08T18:25:20,901 ERROR: Command errored out with exit status 1: 'c:\users\andre\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\andre\\AppData\\Local\\Temp\\pip-install-y6n2f026\\nmslib\\setup.py'"'"'; __file__='"'"'C:\\Users\\andre\\AppData\\Local\\Temp\\pip-install-y6n2f026\\nmslib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\andre\AppData\Local\Temp\pip-record-90f_5c93\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
2019-08-08T18:25:20,902 Exception information:
2019-08-08T18:25:20,902 Traceback (most recent call last):
2019-08-08T18:25:20,902 File "c:\users\andre\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\cli\base_command.py", line 188, in main
2019-08-08T18:25:20,902 status = self.run(options, args)
2019-08-08T18:25:20,902 File "c:\users\andre\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\commands\install.py", line 407, in run
2019-08-08T18:25:20,902 use_user_site=options.use_user_site,
2019-08-08T18:25:20,902 File "c:\users\andre\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\req\__init__.py", line 58, in install_given_reqs
2019-08-08T18:25:20,902 **kwargs
2019-08-08T18:25:20,902 File "c:\users\andre\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\req\req_install.py", line 959, in install
2019-08-08T18:25:20,902 spinner=spinner,
2019-08-08T18:25:20,902 File "c:\users\andre\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\utils\misc.py", line 934, in call_subprocess
2019-08-08T18:25:20,902 raise InstallationError(exc_msg)
2019-08-08T18:25:20,902 pip._internal.exceptions.InstallationError: Command errored out with exit status 1: 'c:\users\andre\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\andre\\AppData\\Local\\Temp\\pip-install-y6n2f026\\nmslib\\setup.py'"'"'; __file__='"'"'C:\\Users\\andre\\AppData\\Local\\Temp\\pip-install-y6n2f026\\nmslib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\andre\AppData\Local\Temp\pip-record-90f_5c93\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
A few weeks ago I had the same issue and amongst the million things I tried I was able to get it to work, but at the time I wasn't entirely sure how I did it. I'm now on a new computer and the issue won't go away.

nmslib is a python wrapper over a c++ library. Therefore it could cause problems on few systems. I had the same issue.
Please clone the repository from here and install manually instead of the pip installation.
Try one of the following.
As per the comments from here,nmslib is optional and is only required if you use it for linker.So you may comment it from the requirements.txt and then do a manual installation via setup.py
Or
In your requirements.txt file add numpy to the top and install via setup.py file.
Though the above steps may throw a VC++ error, the scispacy module will get installed and you will be able to import it.
I tried both the solutions and they worked for me.
Note : Also, from the comments I understand that, now we may directly use spacy and load the scispacy models provided you have downloaded and installed the models.
pip install en_core_sci_sm
import spacy
nlp = spacy.load("en_core_sci_sm")
Let me know which one works for you.

Related

No such file or directory Error when trying to install fcntl using pip?

I'm trying to install fcntl with pip and I entered this into cmd:
pip install pycopy-fcntl
However, this error pops up and I have no idea what it is or how to fix it:
Collecting pycopy-fcntl
Using cached pycopy-fcntl-0.0.4.tar.gz (868 bytes)
ERROR: Command errored out with exit status 1:
command: 'c:\users\jackson\appdata\local\programs\python\python38\python.exe' -c 'import sys,
setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Jackson\\AppData\\Local\\Temp\\pip-install-l2eoh603\\pycopy-fcntl\\setup.py'"'"'; __file__='"'"'C:\\Users\\Jackson\\AppData\\Local\\Temp\\pip-install-l2eoh603\\pycopy-fcntl\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Jackson\AppData\Local\Temp\pip-pip-egg-info-j3akvbte'
cwd: C:\Users\Jackson\AppData\Local\Temp\pip-install-l2eoh603\pycopy-fcntl\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\jackson\appdata\local\programs\python\python38\lib\tokenize.py", line 392, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory:
'C:\\Users\\Jackson\\AppData\\Local\\Temp\\pip-install-l2eoh603\\pycopy-fcntl\\setup.py'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full
command output.
Any thoughts on how I can fix this?
The home page at https://github.com/pfalcon/pycopy-lib#readme says:
pycopy-lib is a project to develop a non-monolithic standard library for the Pycopy project
It's not a pip-installable library, it's not even Python library at all. It's a library for Pycopy which is (https://github.com/pfalcon/pycopy#readme):
Pycopy aims to develop and maintain a minimalist, lightweight, and extensible implementation of Python(-compatible) language.
What are you really trying to install? Module fcntl? It's a module from stdlib since the dawn of time: https://docs.python.org/2.6/library/fcntl.html

Openstack-ansible setup-openstack.yml Error on Task [os_keystone: Create fernet keys for Keystone]

can someone help me?,
Openstack-ansible git tags 20.0.0 (f2ff7902)
I'm having trouble when running openstack-ansible setup-openstack.yml
Keystone Version 20.0.0
Failure On TASK [os_keystone : Create fernet keys for Keystone] ***********************************************************************************************
fatal: [infra1_keystone_container-54825051]: FAILED! => {"changed": false, "cmd": "/openstack/venvs/keystone-20.0.0/bin/keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone", "msg": "[Errno 2] No such file or directory", "rc": 2}
Why is it missing keystone-manage file?
Then, I tried to run pip install requirement on keystone container but get the following error, here is the command I run on target host and its error
sudo lxc-attach --name infra1_keystone_container-54825051
cd /openstack/venvs/keystone-20.0.0
source /bin/activate
pip install -r requirements.txt
Error:
(keystone-20.0.0) [root#infra1-keystone-container-54825051 keystone-20.0.0]# pip install -r requirements.txt
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting keystone
Using cached https://files.pythonhosted.org/packages/4e/e6/22f5a2ee899c4cca1b20e07458ac72cb267ca5ad162f77affea942161fe9/keystone-16.0.0-py2.py3-none-any.whl
Collecting ldappool
Using cached https://files.pythonhosted.org/packages/a4/f2/e62f2f12a871b7bba62d446a20eec8362cae6fa4c55c3d73c587204dc551/ldappool-2.4.1-py2.py3-none-any.whl
Collecting osprofiler
Using cached https://files.pythonhosted.org/packages/22/83/031090f9e6ecb58c520f5bda37a8260ffc953abe2751c435c429fd5d1a96/osprofiler-2.9.0-py2.py3-none-any.whl
Collecting PyMySQL
Using cached https://files.pythonhosted.org/packages/ed/39/15045ae46f2a123019aa968dfcba0396c161c20f855f11dea6796bcaae95/PyMySQL-0.9.3-py2.py3-none-any.whl
Collecting pyngus
Using cached https://files.pythonhosted.org/packages/58/b1/336b8f64e7e4efa9b95027af71e02cd4cfacca8f919345badb852381878a/pyngus-2.3.0.zip
Collecting python-memcached
Using cached https://files.pythonhosted.org/packages/f5/90/19d3908048f70c120ec66a39e61b92c253e834e6e895cd104ce5e46cbe53/python_memcached-1.59-py2.py3-none-any.whl
Collecting python-openstackclient
Using cached https://files.pythonhosted.org/packages/9b/09/c45ba3f9436f5b26691a4b1a309c959903bda6d8a5be04eec14f32db451a/python-openstackclient-5.2.0.tar.gz
Collecting systemd-python
Using cached https://files.pythonhosted.org/packages/e8/a8/00ba0f605837a8f69523e6c3a4fb14675a6430c163f836540129c50b3aef/systemd-python-234.tar.gz
ERROR: Command errored out with exit status 1:
command: /openstack/venvs/keystone-20.0.0/bin/python2 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-QecSqm/systemd-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-QecSqm/systemd-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-QecSqm/systemd-python/pip-egg-info
cwd: /tmp/pip-install-QecSqm/systemd-python/
Complete output (12 lines):
Cannot find libsystemd or libsystemd-journal:
Package libsystemd was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsystemd.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libsystemd' found
Package libsystemd-journal was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsystemd-journal.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libsystemd-journal' found
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 19.3; however, version 20.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The target host machine is CentOS 7
This error happens because there is a task on ansible install venv packages from repo_server, my repo_server is on lxc_container on infra1 host, it cant be reached, when the package search for repo on 10.0.0.246( infra1 host) it failed to get the repo inside infra1_host, because I need a load balance for it, So I added haproxy by following the openstack-ansible documentation, then repo_server now can be reached and the error is fixed.
Below solution shouldn't be used since error shouldnt happen if the installation is followed correctly.
I tried to overcome error of
pip install -r requirements.txt
I am missing systemd-devel, after running on keystone lxc container
sudo yum install systemd-devel
and manually pip install -r requirements.txt again ( I think this is not needed)
I passed that task
Note: I asked on openstack-ansible channel, then someone good help me and give tips that
I need to be careful using pip like that, you've not use the
constraints / global-constraints files and
in general we would never do that, use the ansible playbooks (and the related python_venv_build ansible role) to manage the contents of the virtualenvs

pip install robotframework-desktoplibrary : failed. Why can't install?

I tried to install desktoplibrary but get the error below :
pip install robotframework-desktoplibrary
Collecting robotframework-desktoplibrary
Downloading https://files.pythonhosted.org/packages/2f/dc/02d773cb2a052a77b226
e11a7104d506ecb827798bb4395757104eb0118f/robotframework-desktoplibrary-1.0.1.zip
(15.6MB)
|████████████████████████████████| 15.6MB 1.7MB/s
ERROR: Command errored out with exit status 1:
command: 'c:\users\sqaadmin\appdata\local\programs\python\python37\python.e
xe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sqaadmin
\\AppData\\Local\\Temp\\1\\pip-install-1m3ui56u\\robotframework-desktoplibrary\\
setup.py'"'"'; __file__='"'"'C:\\Users\\sqaadmin\\AppData\\Local\\Temp\\1\\pip-i
nstall-1m3ui56u\\robotframework-desktoplibrary\\setup.py'"'"';f=getattr(tokenize
, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'
"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-ba
se 'C:\Users\sqaadmin\AppData\Local\Temp\1\pip-install-1m3ui56u\robotframework-d
esktoplibrary\pip-egg-info'
cwd: C:\Users\sqaadmin\AppData\Local\Temp\1\pip-install-1m3ui56u\robotf
ramework-desktoplibrary\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\sqaadmin\AppData\Local\Temp\1\pip-install-1m3ui56u\robotfra
mework-desktoplibrary\setup.py", line 4, in <module>
execfile(join(dirname(abspath(__file__)), 'target', 'src', 'SikuliLibrar
y', 'version.py'))
NameError: name 'execfile' is not defined
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check th
e logs for full command output.
The library being installed does not support Python3. "execfile" python function it uses in its setup.py file is deprecated in python3 and thus, you get this sort of error.
If you are intending to test a windows desktop perhaps use windappdriver with the Desktop library portion of https://github.com/Accruent/robotframework-zoomba

Error messages when installing OSMnx and GeoPandas

Hello I am trying to install OSMnx and GeoPandas using pip install osmnx and pip install geopandas (according to this link: https://geoffboeing.com/2016/11/osmnx-python-street-networks/) It says that in order to use OSMnx you have to install geopandas and rtree first, rtree was installed with no issues, but this happened when trying to install osmnx (actually I tried to install osmnx before I found out that I need to install geopandas, I am giving this error here in order to give you as much information as possible)
ERROR: Command errored out with exit status 1:
command: 'c:\users\hodor\appdata\local\programs\python\python37\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Hodor\\AppData\\Local\\Temp\\pip-install-m1_7rif2\\Shapely\\setup.py'"'"'; __file__='"'"'C:\\Users\\Hodor\\AppData\\Local\\Temp\\pip-install-m1_7rif2\\Shapely\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Hodor\AppData\Local\Temp\pip-install-m1_7rif2\Shapely\pip-egg-info'
cwd: C:\Users\Hodor\AppData\Local\Temp\pip-install-m1_7rif2\Shapely\
Complete output (9 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Hodor\AppData\Local\Temp\pip-install-m1_7rif2\Shapely\setup.py", line 80, in <module>
from shapely._buildcfg import geos_version_string, geos_version, \
File "C:\Users\Hodor\AppData\Local\Temp\pip-install-m1_7rif2\Shapely\shapely\_buildcfg.py", line 200, in <module>
lgeos = CDLL("geos_c.dll")
File "c:\users\hodor\appdata\local\programs\python\python37\lib\ctypes\__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] Given module was not found
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
What shall I do (I do NOT want to install anaconda, so if there is a way of avoiding anaconda I would be very happy)?
Any help appreciated, thank you very much
EDIT: OK I tried the steps explained in the question mentioned as a duplicate of my question, I was able to install fiona following these steps but when I typed pip install geopandas I got this new error:
ERROR: Command errored out with exit status 1:
command: 'c:\users\hodor\appdata\local\programs\python\python37\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Hodor\\AppData\\Local\\Temp\\pip-install-5yg59bp6\\shapely\\setup.py'"'"'; __file__='"'"'C:\\Users\\Hodor\\AppData\\Local\\Temp\\pip-install-5yg59bp6\\shapely\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Hodor\AppData\Local\Temp\pip-install-5yg59bp6\shapely\pip-egg-info'
cwd: C:\Users\Hodor\AppData\Local\Temp\pip-install-5yg59bp6\shapely\
Complete output (9 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Hodor\AppData\Local\Temp\pip-install-5yg59bp6\shapely\setup.py", line 80, in <module>
from shapely._buildcfg import geos_version_string, geos_version, \
File "C:\Users\Hodor\AppData\Local\Temp\pip-install-5yg59bp6\shapely\shapely\_buildcfg.py", line 200, in <module>
lgeos = CDLL("geos_c.dll")
File "c:\users\hodor\appdata\local\programs\python\python37\lib\ctypes\__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] Uvedený modul nebyl nalezen
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
EDIT 2: Even though the cmd wrote "succesfully installed fiona" when I tried to run simple Attempt.py
import fiona
I got this message:
Traceback (most recent call last):
File "c:\Users\Hodor\.vscode\extensions\ms-python.python-2019.10.41019\pythonFiles\ptvsd_launcher.py", line 43, in <module>
main(ptvsdArgs)
File "c:\Users\Hodor\.vscode\extensions\ms-python.python-2019.10.41019\pythonFiles\lib\python\old_ptvsd\ptvsd\__main__.py", line 432, in main
run()
File "c:\Users\Hodor\.vscode\extensions\ms-python.python-2019.10.41019\pythonFiles\lib\python\old_ptvsd\ptvsd\__main__.py", line 316, in run_file
runpy.run_path(target, run_name='__main__')
File "C:\Users\Hodor\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "C:\Users\Hodor\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\Users\Hodor\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "c:\Users\Hodor\Desktop\Untitled-1.py", line 1, in <module>
import fiona
File "C:\Users\Hodor\AppData\Local\Programs\Python\Python37\lib\site-packages\fiona\__init__.py", line 87, in <module>
from fiona.collection import BytesCollection, Collection
File "C:\Users\Hodor\AppData\Local\Programs\Python\Python37\lib\site-packages\fiona\collection.py", line 9, in <module>
from fiona.ogrext import Iterator, ItemsIterator, KeysIterator
ImportError: DLL load failed: Module not found
This may also help with troubleshooting of my issue
It can be really difficult to install the geospatial dependencies with pip, primarily due to Fiona in my experience. If you can use conda, it's strongly recommended to follow the install instructions in the OSMnx documentation
If you have any trouble with the installation, try installing OSMnx in a new, clean conda environment using conda-forge and strict channel priority:
conda config --prepend channels conda-forge
conda create -n ox --strict-channel-priority python=3 osmnx

EC2: permissions are denied

Am a developer i have no good knowledge on how to setup a server on AWS EC2 instance but what am trying to do is to setup thumbor server on EC2 thumbor is built with python and, am follwing this steps to get it up and running setup thumbor.
However, when i try to do install the following package using the user of the the EC2 ec2-user:
pip install numpy
i got this error:
running install_lib
creating /usr/local/lib64/python2.7/site-packages/numpy
error: could not create '/usr/local/lib64/python2.7/site-packages/numpy': Permission denied
----------------------------------------
Command "/usr/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-Ibmsr4/numpy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-afbRUs-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-Ibmsr4/numpy
i switched to the roor user and triedn to install the same package i got this error:
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3020, in <module>
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 616, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 629, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 807, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==6.1.1
My question is what cause this problem and how i could install this package so i can continue the proccess of seting up the server !
Note: am using putty on Windows also i successed to install many packages previously so i can tell my creation to the EC2 is correct.

Resources