Error messages when installing OSMnx and GeoPandas - pip

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

Related

Unable to install psychopy in pycharm - problem with setup tools

I'm trying to install psychopy within pycharm but keep getting the following error. I have a Mac and I'm using PyCharm 2022.3.2 (Professional Edition).
Defaulting to user installation because normal site-packages is not writeable
Collecting PsychoPy
Using cached PsychoPy-2022.2.5.zip (26.1 MB)
Collecting requests[security]
Using cached requests-2.28.2-py3-none-any.whl (62 kB)
Collecting cryptography
Using cached cryptography-39.0.0.tar.gz (603 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /Library/Developer/CommandLineTools/usr/bin/python3 /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /var/folders/93/tfwyd2_n7lj79pnxrfkcn_gw0000gn/T/tmpnxyuxd3l
cwd: /private/var/folders/93/tfwyd2_n7lj79pnxrfkcn_gw0000gn/T/pip-install-xg71migq/cryptography
Complete output (29 lines):
=============================DEBUG ASSISTANCE==========================
If you are seeing an error here please try the following to
successfully install cryptography:
Upgrade to the latest pip and try again. This will fix errors for most
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
=============================DEBUG ASSISTANCE==========================
Traceback (most recent call last):
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
main()
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 114, in get_requires_for_build_wheel
return hook(config_settings)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/build_meta.py", line 146, in get_requires_for_build_wheel
return self._get_build_requires(
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/build_meta.py", line 127, in _get_build_requires
self.run_setup()
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/build_meta.py", line 142, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 18, in <module>
from setuptools_rust import RustExtension
File "/private/var/folders/93/tfwyd2_n7lj79pnxrfkcn_gw0000gn/T/pip-build-env-g0unt5yo/overlay/lib/python3.8/site-packages/setuptools_rust/__init__.py", line 1, in <module>
from .build import build_rust
File "/private/var/folders/93/tfwyd2_n7lj79pnxrfkcn_gw0000gn/T/pip-build-env-g0unt5yo/overlay/lib/python3.8/site-packages/setuptools_rust/build.py", line 23, in <module>
from setuptools.command.build import build as CommandBuild # type: ignore[import]
ModuleNotFoundError: No module named 'setuptools.command.build'
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Developer/CommandLineTools/usr/bin/python3 /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /var/folders/93/tfwyd2_n7lj79pnxrfkcn_gw0000gn/T/tmpnxyuxd3l Check the logs for full command output.
WARNING: You are using pip version 20.2.3; however, version 22.3.1 is available.
You should consider upgrading via the '/Library/Developer/CommandLineTools/usr/bin/python3 -m pip install --upgrade pip' command.
I would massively appreciate any help, thanks!

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

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

ImportError: No module named 'thinc.about'

I am trying to install spacy for windows, python 3.x.
I ran the following commands:-
conda install -c conda-forge spacy
python -m spacy download en
"python -m spacy download en" gives the error:-
Traceback (most recent call last):
File "D:\Anaconda3\lib\runpy.py", line 174, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "D:\Anaconda3\lib\runpy.py", line 133, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "D:\Anaconda3\lib\runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "D:\Anaconda3\lib\site-packages\spacy\__init__.py", line 4, in <module>
from .cli.info import info as cli_info
File "D:\Anaconda3\lib\site-packages\spacy\cli\__init__.py", line 1, in <module>
from .download import download
File "D:\Anaconda3\lib\site-packages\spacy\cli\download.py", line 10, in <module>
from .link import link
File "D:\Anaconda3\lib\site-packages\spacy\cli\link.py", line 7, in <module>
from ..compat import symlink_to, path2str
File "D:\Anaconda3\lib\site-packages\spacy\compat.py", line 11, in <module>
from thinc.neural.util import copy_array
File "D:\Anaconda3\lib\site-packages\thinc\__init__.py", line 1, in <module>
from .about import *
ImportError: No module named 'thinc.about'
and the same error when I try to import spacy thereafter. What should I do to successfully install spacy?
I found this link from where I downloaded all of the required whls one by one to install spacy.
Compiling wheel rather than downloading ready one might be helpful as well:
python -m pip install thinc --no-binary=:all:
or
pip install thinc --no-binary=:all:
Don't forget to add --force option if you already have the package.
More information about --no-binary option:
https://pip.pypa.io/en/latest/cli/pip_install/#cmdoption-no-binary

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