Getting error code 1 while installing geopandas with pip - python

This is the error I get when trying to install geopandas using pip install geopandas. I'm using Python 3.7.
Collecting geopandas
Using cached https://files.pythonhosted.org/packages/24/11/d77c157c16909bd77557d00798b05a5b6615ed60acb5900fbe6a65d35e93/geopandas-0.4.0-py2.py3-none-any.whl
Collecting pyproj (from geopandas)
Using cached https://files.pythonhosted.org/packages/29/72/5c1888c4948a0c7b736d10e0f0f69966e7c0874a660222ed0a2c2c6daa9f/pyproj-1.9.5.1.tar.gz
Complete output from command python setup.py egg_info:
using bundled proj4..
Traceback (most recent call last):
File "c:\users\public\anaconda3\lib\site-packages\setuptools\msvc.py", line 489, in _find_latest_available_vc_ver
return self.find_available_vc_vers()[-1]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\AVIMAT~1\AppData\Local\Temp\pip-install-hnb_xdmp\pyproj\setup.py", line 72, in <module>
objects = cc.compile(['nad2bin.c', 'src/pj_malloc.c'])
File "c:\users\public\anaconda3\lib\distutils\_msvccompiler.py", line 345, in compile
self.initialize()
File "c:\users\public\anaconda3\lib\distutils\_msvccompiler.py", line 238, in initialize
vc_env = _get_vc_env(plat_spec)
File "c:\users\public\anaconda3\lib\site-packages\setuptools\msvc.py", line 185, in msvc14_get_vc_env
return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env()
File "c:\users\public\anaconda3\lib\site-packages\setuptools\msvc.py", line 843, in __init__
self.si = SystemInfo(self.ri, vc_ver)
File "c:\users\public\anaconda3\lib\site-packages\setuptools\msvc.py", line 485, in __init__
self.vc_ver = vc_ver or self._find_latest_available_vc_ver()
File "c:\users\public\anaconda3\lib\site-packages\setuptools\msvc.py", line 492, in _find_latest_available_vc_ver
raise distutils.errors.DistutilsPlatformError(err)
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\AVIMAT~1\AppData\Local\Temp\pip-install-hnb_xdmp\pyproj\
I have already tried a bunch of other methods, like upgrading setuptools or downloading the Fiona and GDAL binary files, but none of them seem to work.

As the Traceback says: Download this
https://visualstudio.microsoft.com/downloads/
This will give you the C++ libs required by the lib that you're installing

The problem is in compiling pyproj. Try to install a pre-compiled binary from https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyproj

this helped me out
pip install wheel
pip install pipwin
pipwin install numpy
pipwin install pandas
pipwin install shapely
pipwin install gdal
pipwin install fiona
pipwin install pyproj
pipwin install six
pipwin install rtree
pipwin install geopandas

Related

Getting "error while generating package metadata" when installing TkFontAwesome

I'm trying to install TkFontAwesome using python -m pip install tkfontawesome, but always get the following error:
Collecting tkfontawesome
Using cached tkfontawesome-0.2.0-py3-none-any.whl (405 kB)
Collecting tksvg==0.7.4
Using cached tksvg-0.7.4.tar.gz (50 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
Installing dependency cmake... Traceback (most recent call last):
File "<string>", line 36, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\myuser\AppData\Local\Temp\pip-install-2krbeh5s\tksvg_7491a69795da43779e9e71e527849349\setup.py", line 62, in <module>
sp.call(["pacman", "--needed", "--noconfirm", "-S", "mingw-w64-x86_64-{}".format(dep)]) # , stdout=sp.PIPE)
File "C:\Users\myuser\AppData\Local\Programs\Thonny\lib\subprocess.py", line 339, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\Users\myuser\AppData\Local\Programs\Thonny\lib\subprocess.py", line 800, in __init__
restore_signals, start_new_session)
File "C:\Users\myuser\AppData\Local\Programs\Thonny\lib\subprocess.py", line 1207, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Never had any problems installing packages using pip before. The file subprocess.py IS in \Thonny\lib\ if this WinError 2 means that.
I'm using:
Python 3.7.7
pip 22.0.3
Tk 8.6.9
Thonny 3.2.7
Windows 10
So far i've tried:
to update my pip and setuptools (they're already up-to-date)
to install TkFontAwesome using ez_setup
to install TkFontAwesome using --use-deprecated=backtrack-on-build-failures
No use. Anyone have any ideas what to do next? Thanks in advance.
Try add this after your pip3 install package:
--use-deprecated=backtrack-on-build-failures
eg, if you want:
pip3 install imageAI
then:
pip3 install imageAI --use-deprecated=backtrack-on-build-failures
copy from there.

pyinstaller or any pip packages commands won't work

I keep getting this. Also whenever i try to upgrade pip it just stalls and sits on uninstalling forever.
How do i go about fixing this?
C:\Users\Jordan>pip install pyinstaller
Collecting pyinstaller
Using cached https://files.pythonhosted.org/packages/e2/c9/0b44b2ea87ba36395483a672fddd07e6a9cb2b8d3c4a28d7ae76c7e7e1e5/PyInstaller-3.5.tar.gz
Installing build dependencies ... done
Getting requirements to build wheel ... error
Complete output from command "c:\program files (x86)\python37-32\python.exe" "c:\program files (x86)\python37-32\lib\site-packages\pip\_vendor\pep517\_in_process.py" get_requires_for_build_wheel C:\Users\Jordan\AppData\Local\Temp\tmpb_jok3bp:
Traceback (most recent call last):
File "c:\program files (x86)\python37-32\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 207, in <module>
main()
File "c:\program files (x86)\python37-32\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 197, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "c:\program files (x86)\python37-32\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 54, in get_requires_for_build_wheel
return hook(config_settings)
File "C:\Users\Jordan\AppData\Local\Temp\pip-build-env-4q5xlolk\overlay\Lib\site-packages\setuptools\build_meta.py", line 146, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "C:\Users\Jordan\AppData\Local\Temp\pip-build-env-4q5xlolk\overlay\Lib\site-packages\setuptools\build_meta.py", line 127, in _get_build_requires
self.run_setup()
File "C:\Users\Jordan\AppData\Local\Temp\pip-build-env-4q5xlolk\overlay\Lib\site-packages\setuptools\build_meta.py", line 142, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 20, in <module>
from PyInstaller import __version__ as version, HOMEPATH, PLATFORM
ModuleNotFoundError: No module named 'PyInstaller'
----------------------------------------
Command ""c:\program files (x86)\python37-32\python.exe" "c:\program files (x86)\python37-32\lib\site-packages\pip\_vendor\pep517\_in_process.py" get_requires_for_build_wheel C:\Users\Jordan\AppData\Local\Temp\tmpb_jok3bp" failed with error code 1 in C:\Users\Jordan\AppData\Local\Temp\pip-install-zhgjxcsa\pyinstaller
You are using pip version 19.0.1, however version 19.3.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Try the following steps
Downgrade pip from version 19 to 18.1: pip install pip==18.1
Now install PyInstaller using following command: pip install pyinstaller
Once the pyinstaller installed you can upgrade your pip again :
python -m pip install --upgrade pip

Geopandas installation error distutils.errors.CompileError

I have been using pip install geopandas for installing the library on my Mac (OS: Mojave v10.14). However, I have been unsuccessful to install so far.
Here is the error I get:
Collecting pyproj (from geopandas)
Downloading https://files.pythonhosted.org/packages/26/8c/1da0580f334718e04f8bbf74f0515a7fb8185ff96b2560ce080c11aa145b/pyproj-1.9.6.tar.gz (2.8MB)
100% |████████████████████████████████| 2.8MB 9.0MB/s
Complete output from command python setup.py egg_info:
using bundled proj4..
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-install-C35peF/pyproj/setup.py", line 86, in <module>
objects = cc.compile(['nad2bin.c', 'src/pj_malloc.c'])
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/unixccompiler.py", line 125, in _compile
raise CompileError, msg
distutils.errors.CompileError: command 'cc' failed with exit status 1
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-install-C35peF/pyproj/
Any ideas why this might be happening and how can I fix this?
Pyproj PyPI is outdated. You can either install GeoPandas via Conda or follow steps described in this GH issue https://github.com/geopandas/geopandas/issues/793 and install pyproj beforehand from Github via
pip install git+https://github.com/jswhit/pyproj.git#egg=pyproj
and then go for pip install geopandas.

i can't install mysqlclient and pillow in python

i want to install mysqlclient but it returns me
(venv)amir#amg76:~/Documents/Computer/Python/Django/vira/virasciencecom$ pip3 install mysqlclient==1.3.7
Collecting mysqlclient==1.3.7
Using cached mysqlclient-1.3.7.tar.gz
Complete output from command python setup.py egg_info:
/bin/sh: 1: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-c5i8m5ok/mysqlclient/setup.py", line 17, in <module>
metadata, options = get_config()
File "/tmp/pip-build-c5i8m5ok/mysqlclient/setup_posix.py", line 44, in get_config
libs = mysql_config("libs_r")
File "/tmp/pip-build-c5i8m5ok/mysqlclient/setup_posix.py", line 26, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
OSError: mysql_config not found
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-c5i8m5ok/mysqlclient/
the same thing happen when i try to install pillow and i use python 3.6 and ubuntu 17.10
can any body help me?
You need to install libmysqlclient-dev or libmariaclient-dev from your distro package repository, depending whether you're using mysql or mariadb respectively.

Python: Matplotlib Install Issues

I have mac OSX 10.7.5 and I'm trying to install matplotlib, but I keep having issues.
Kristas-MacBook-Pro:lib Krista$ brew install matplotlib
==> Installing matplotlib dependency: numpy
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> Downloading https://downloads.sourceforge.net/project/numpy/NumPy/1.8.1/nump
Already downloaded: /Library/Caches/Homebrew/numpy-1.8.1.tar.gz
==> Downloading https://pypi.python.org/packages/source/n/nose/nose-1.3.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/numpy--nose-1.3.1.tar.gz
==> python setup.py install --prefix=/usr/local/Cellar/numpy/1.8.1 --single-vers
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: option --single-version-externally-managed not recognized
READ THIS: https://github.com/Homebrew/homebrew/wiki/troubleshooting
If reporting this issue please do so at (not Homebrew/homebrew):
https://github.com/homebrew/homebrew-python/issues
I'm not sure what to do? I tried brew doctor etc, as suggested by that website, but am just lost. Any help?
When trying to install distribute I get this error (and when trying to upgrade setuptools, I also get it)
Kristas-MacBook-Pro:lib Krista$ pip install distribute
Downloading/unpacking distribute
Downloading distribute-0.7.3.zip (145kB): 145kB downloaded
Running setup.py (path:/private/var/folders/1z/b3f7sbv11gv2jvy113vy8m180000gn/T/pip_build_Krista/distribute/setup.py) egg_info for package distribute
Downloading/unpacking setuptools>=0.7 (from distribute)
Downloading setuptools-5.4.1-py2.py3-none-any.whl (528kB): 528kB downloaded
Installing collected packages: setuptools, distribute
Found existing installation: setuptools 0.6c12dev-r85381
Uninstalling setuptools:
Cleaning up...
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1431, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 598, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1836, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/util.py", line 295, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 293, in move
OSError: [Errno 13] Permission denied: '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/easy_install.py'
Storing debug log for failure in /Users/Krista/Library/Logs/pip.log
You need to update setuptools (https://pypi.python.org/pypi/setuptools) or install Distribute (https://pypi.python.org/pypi/distribute/0.7.3)

Categories

Resources