I am trying install geopandas. I have using codes I can't find but i keep getting error messages. I have geopy already installed but can't install geopandas.
Result i had when running installation with anaconda prompt:
I had also tried installation using %pip install geopandas --user
Collecting geopandas
Using cached geopandas-0.8.1-py2.py3-none-any.whl (962 kB)
Collecting pyproj>=2.2.0
Using cached pyproj-2.6.1.post1-cp38-cp38-win32.whl (15.7 MB)
Collecting shapely
Using cached Shapely-1.7.1-cp38-cp38-win32.whl (894 kB)
Requirement already satisfied: pandas>=0.23.0 in c:\users\fejiro\anaconda3\lib\site-packages (from geopandas) (1.0.5)
Collecting fiona
Using cached Fiona-1.8.17.tar.gz (1.3 MB)
Note: you may need to restart the kernel to use updated packages.
ERROR: Command errored out with exit status 1:
command: 'C:\Users\fejiro\anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\fejiro\\AppData\\Local\\Temp\\pip-install-q86d5ghj\\fiona\\setup.py'"'"'; __file__='"'"'C:\\Users\\fejiro\\AppData\\Local\\Temp\\pip-install-q86d5ghj\\fiona\\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\fejiro\AppData\Local\Temp\pip-pip-egg-info-64u_nnsk'
cwd: C:\Users\fejiro\AppData\Local\Temp\pip-install-q86d5ghj\fiona\
Complete output (1 lines):
A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Can someone tell what to do?
It s better to use Anaconda distribution for more complex packages. Use install anaconda and then create an environment for the project. After that, you could use conda-forge to take care of all the compatibility problems
Related
This question already has answers here:
Error while downloading the requirements using pip install (setup command: use_2to3 is invalid.)
(6 answers)
Closed 1 year ago.
I am trying to install ibm_db_sa in my miniconda virtual environment (python 3.6). I am seeing this error and it could be because I am a separate user on my laptop and not the admin. Is there any solution/workaround this?
sudo pip install ibm_db_sa
Password:
WARNING: The directory '/Users/myname/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting ibm_db_sa
Downloading ibm_db_sa-0.3.7.tar.gz (30 kB)
Requirement already satisfied: sqlalchemy>=0.7.3 in /usr/local/Caskroom/miniconda/base/envs/finalenv/lib/python3.6/site-packages (from ibm_db_sa) (1.4.25)
Collecting ibm_db>=2.0.0
Downloading ibm_db-3.0.4.tar.gz (796 kB)
|████████████████████████████████| 796 kB 1.1 MB/s
ERROR: Command errored out with exit status 1:
command: /usr/local/Caskroom/miniconda/base/envs/finalenv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-2fdrlxey/ibm-db_375dbdf21455451c871e608261014786/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-2fdrlxey/ibm-db_375dbdf21455451c871e608261014786/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 /private/tmp/pip-pip-egg-info-jzevidp0
cwd: /private/tmp/pip-install-2fdrlxey/ibm-db_375dbdf21455451c871e608261014786/
Complete output (3 lines):
Detected 64-bit Python
Downloading https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/macos64_odbc_cli.tar.gz
error in ibm_db setup command: use_2to3 is invalid.
WARNING: Discarding https://files.pythonhosted.org/packages/b6/0c/a8d57078772abcc876f6a2be2252f12284aa6f71f41d3c2910f23369d7d2/ibm_db-2.0.6.1.tar.gz#sha256=bdc6543702e19d8ff7a0ddef715a9ee32a7753686cbcfe99095c2e357efe4135 (from https://pypi.org/simple/ibm-db/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Downloading ibm_db-2.0.5.1.tar.gz (460 kB)
|████████████████████████████████| 460 kB 1.1 MB/s
ERROR: No .egg-info directory found in /private/tmp/pip-pip-egg-info-y8tp952r
The issue you ran into seems related to a problem with setuptools. See this issue in the GitHub repository for the ibm_db driver.
I was trying to install guidedlda on google colab notebook but it keeps giving me errors the following code i have used so far.
!pip install guidedlda
pip install guidedlda
https://github.com/vi3k6i5/GuidedLDA
cd GuidedLDA
sh build_dist.sh
python setup.py sdist
pip install -e
I kept getting the following error. If someone knows how to fix this on google colab please let me know
Collecting guidedlda Using cached
https://files.pythonhosted.org/packages/f8/ee/6d6e2b3525388399e12a4482554c7529a5fcf5e99c50a60abaa02894b8bf/guidedlda-2.0.0.dev22.tar.gz
Requirement already satisfied: numpy in
/usr/local/lib/python3.7/dist-packages (from guidedlda) (1.19.5)
Building wheels for collected packages: guidedlda Building wheel for
guidedlda (setup.py) ... error ERROR: Failed building wheel for
guidedlda Running setup.py clean for guidedlda Failed to build
guidedlda Installing collected packages: guidedlda
Running setup.py install for guidedlda ... error ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys,
setuptools, tokenize; sys.argv[0] =
'"'"'/tmp/pip-install-1u3r_cht/guidedlda/setup.py'"'"';
file='"'"'/tmp/pip-install-1u3r_cht/guidedlda/setup.py'"'"';f=getattr(tokenize,
'"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))'
install --record /tmp/pip-record-wpryz4pa/install-record.txt
--single-version-externally-managed --compile Check the logs for full command output.
You probably saw this, but just in case : https://guidedlda.readthedocs.io/en/latest/
If pip install doesn’t work then try the next step.
https://github.com/vi3k6i5/GuidedLDA
cd GuidedLDA
sh build_dist.sh
python setup.py sdist
pip install -e .
This error raised while installing geopandas in vs code. I've looking for its solution on the web, but none of them really explain what happened and how to solve it..
Collecting geopandas
Downloading geopandas-0.7.0-py2.py3-none-any.whl (928 kB)
|████████████████████████████████| 928 kB 726 kB/s
Collecting shapely
Downloading Shapely-1.7.0-cp38-cp38-win32.whl (895 kB)
|████████████████████████████████| 895 kB 437 kB/s
Requirement already satisfied: pandas>=0.23.0 in c:\users\mayank\appdata\local\programs\python\python38-32\lib\site-packages (from geopandas) (1.0.3)
Collecting fiona
Downloading Fiona-1.8.13.post1.tar.gz (1.2 MB)
|████████████████████████████████| 1.2 MB 506 kB/s
ERROR: Command errored out with exit status 1:
command: 'C:\Users\mayank\AppData\Local\Programs\Python\Python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mayank\\AppData\\Local\\Temp\\pip-install-1le2w4at\\fiona\\setup.py'"'"'; __file__='"'"'C:\\Users\\mayank\\AppData\\Local\\Temp\\pip-install-1le2w4at\\fiona\\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\mayank\AppData\Local\Temp\pip-pip-egg-info-e_ca92eu'
cwd: C:\Users\mayank\AppData\Local\Temp\pip-install-1le2w4at\fiona\
Complete output (1 lines):
A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
First you need to do is to install gdal package. I install it by pip with:
pip install https://download.lfd.uci.edu/pythonlibs/w4tscw6k/GDAL-3.2.2-cp39-cp39-win_amd64.whl
Tips: Do not install it directly through the normal pip usage: pip install gdal . You can find a compatible version of gdal for your python3.x Here.
After you have installed gdal, you can do that for fiano, Eg:
pip install https://download.lfd.uci.edu/pythonlibs/w4tscw6k/Fiona-1.8.18-cp39-cp39-win_amd64.whl
Finally, all of them can be installed successfully...
Fiona which is a dependency of geopandas requires a GDAL instance. When installing it needs looks to the PATH environment variable to find the GDAL location. If the PATH doesn't have a reference it fails to install. I found a work around is to grab the GDAL and fiona whl files and install from a local copy.
$ pip install pyttsx3
Collecting pyttsx3
Using cached pyttsx3-2.80-py3-none-any.whl (39 kB)
Collecting pyobjc>=2.4
Using cached pyobjc-6.1-py3-none-any.whl (2.9 kB)
Collecting comtypes; "win32" in sys_platform
Using cached comtypes-1.1.7.zip (180 kB)
Collecting pyobjc-framework-SyncServices==6.1
Using cached pyobjc-framework-SyncServices-6.1.tar.gz (42 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\abrar\appdata\local\programs\python\python37\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Abrar\\AppData\\Local\\Temp\\pip-install-e8rlz1t4\\pyobjc-framework-SyncServices\\setup.py'"'"'; __file__='"'"'C:\\Users\\Abrar\\AppData\\Local\\Temp\\pip-install-e8rlz1t4\\pyobjc-framework-SyncServices\\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\Abrar\AppData\Local\Temp\pip-install-e8rlz1t4\pyobjc-framework-SyncServices\pip-egg-info'
l = plistlib.readPlist("/System/Library/CoreServices/SystemVersion.plist")
File "c:\users\abrar\appdata\local\programs\python\python3
i m trying this on python 3.7.3 and using latest pip version but i couldn't understand how to fix it
It's a bug in pyttsx3 2.80: https://github.com/nateshmbhat/pyttsx3/issues/82. No fix yet. Try downgrading to pyttsx3 2.71:
pip install -U pyttsx3==2.71
Try to run the following command
pip install git+git://github.com/nateshmbhat/pyttsx3.git
It worked for me
I got the above command from pyttsx3 github issues
If you are using Python 3.x, then you will be using PIP3. To install pyttsx3 for Python 3.x, you will have to use pip3.
If you are using Linux based OS, use the following command.
pip3 show pyttsx3
If you are using Windows,
pip3 install pywin32 pypiwin32 pyttsx3
This copied from Bhutan IO. They have shared interesting examples, in the link given below with YouTube tutorial too.
How to Install pyttsx 3 in Windows
First try installing wheel
pip install wheel
Then you can install pyttsx3, pip install pyttsx3, this should work for you.
After installing shapely/gdal/fiona, I use pip install keplergl in jupyter notebook, the error shows
ERROR: Command errored out with exit status 1:
command: 'D:\Anaconda\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\hyq94\\AppData\\Local\\Temp\\pip-install-bn96hrfp\\fiona\\setup.py'"'"'; __file__='"'"'C:\\Users\\hyq94\\AppData\\Local\\Temp\\pip-install-bn96hrfp\\fiona\\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 pip-egg-info
cwd: C:\Users\hyq94\AppData\Local\Temp\pip-install-bn96hrfp\fiona\
Complete output (1 lines):
A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I have tried conda remove gdal and conda install geopandas, and uninstall and refresh package, but it doesn't work.
Is there any solution? Please help me with this problem : )
When trying to install this I got the same error. My full error was:
ERROR: Command errored out with exit status 1:
command: 'c:\users\tom\appdata\local\programs\python\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\tom\\AppData\\Local\\Temp\\pip-install-gksasqz1\\fiona\\setup.py'"'"'; __file__='"'"'C:\\Users\\tom\\AppData\\Local\\Temp\\pip-install-gksasqz1\\fiona\\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\tom\AppData\Local\Temp\pip-install-gksasqz1\fiona\pip-egg-info'
cwd: C:\Users\tom\AppData\Local\Temp\pip-install-gksasqz1\fiona\
Complete output (1 lines):
A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Here if you look closely you can see the specific line:
A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
Upon looking this up I found this stack overflow question which states that this error has something to do with geopandas. Now the full response in my command prompt was:
C:\WINDOWS\system32>pip install keplergl
Collecting keplergl
Downloading keplergl-0.1.2.tar.gz (5.4 MB)
|████████████████████████████████| 5.4 MB 1.6 MB/s
Collecting ipywidgets<8,>=7.0.0
Downloading ipywidgets-7.5.1-py2.py3-none-any.whl (121 kB)
|████████████████████████████████| 121 kB 2.2 MB/s
Collecting traittypes>=0.2.1
Downloading traittypes-0.2.1-py2.py3-none-any.whl (8.6 kB)
Collecting geopandas>=0.5.0
Downloading geopandas-0.7.0-py2.py3-none-any.whl (928 kB)
|████████████████████████████████| 928 kB 3.3 MB/s
Collecting pandas>=0.23.0
Downloading pandas-1.0.3-cp38-cp38-win32.whl (7.6 MB)
|████████████████████████████████| 7.6 MB 78 kB/s
Collecting Shapely>=1.6.4.post2
Downloading Shapely-1.7.0-cp38-cp38-win32.whl (895 kB)
|████████████████████████████████| 895 kB 544 kB/s
Collecting ipykernel>=4.5.1
Downloading ipykernel-5.2.0-py3-none-any.whl (117 kB)
|████████████████████████████████| 117 kB 2.2 MB/s
Collecting traitlets>=4.3.1
Downloading traitlets-4.3.3-py2.py3-none-any.whl (75 kB)
|████████████████████████████████| 75 kB 1.2 MB/s
Collecting nbformat>=4.2.0
Downloading nbformat-5.0.5-py3-none-any.whl (170 kB)
|████████████████████████████████| 170 kB 3.2 MB/s
Collecting widgetsnbextension~=3.5.0
Downloading widgetsnbextension-3.5.1-py2.py3-none-any.whl (2.2 MB)
|████████████████████████████████| 2.2 MB 364 kB/s
Collecting ipython>=4.0.0; python_version >= "3.3"
Downloading ipython-7.13.0-py3-none-any.whl (780 kB)
|████████████████████████████████| 780 kB 3.3 MB/s
Collecting fiona
Downloading Fiona-1.8.13.post1.tar.gz (1.2 MB)
|████████████████████████████████| 1.2 MB 1.1 MB/s
ERROR: Command errored out with exit status 1:
command: 'c:\users\tom\appdata\local\programs\python\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\tom\\AppData\\Local\\Temp\\pip-install-gksasqz1\\fiona\\setup.py'"'"'; __file__='"'"'C:\\Users\\tom\\AppData\\Local\\Temp\\pip-install-gksasqz1\\fiona\\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\tom\AppData\Local\Temp\pip-install-gksasqz1\fiona\pip-egg-info'
cwd: C:\Users\tom\AppData\Local\Temp\pip-install-gksasqz1\fiona\
Complete output (1 lines):
A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
which shows that more than one item was required including geopandas as shown here:
Collecting geopandas>=0.5.0
Downloading geopandas-0.7.0-py2.py3-none-any.whl (928 kB)
|████████████████████████████████| 928 kB 3.3 MB/s
If my assumption is correct then the error revolves around this area and so the stack overflow question has some importance (based on a educational guess - could be entirely wrong here 😅😅😅). From the first answer to be shown (with 7 up-votes), that has been posted by #JDOaktown, you can see that there are more than one item required for geopandas. As stated in the answer:
pip install wheels
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
Source source source.
If you still have problems,
consider uninstalling the above (pip uninstall) and reinstalling.
You can see from here:
Collecting fiona
Downloading Fiona-1.8.13.post1.tar.gz (1.2 MB)
|████████████████████████████████| 1.2 MB 1.1 MB/s
that one of the items you are told to install is relevant. Not only that - it is before installing Fiona that the error occurs for me - it may be entirely different for you. This answer however does not help much as it is for installing geopandas only and stops before installing the target keplergl. So if you keep going down you reach a post by #Josh Friedlander which has 13 up-votes. Here he states:
Geospatial Data Abstraction Library (GDAL) is a library designed for
vector geospatial data formats. It's a prerequisite for installing
Fiona, the Python API for OGR (which doesn't really stand for
anything), which is in turn a prerequisite for Geopandas. On UNIX-like
systems the gdal-config script tells Fiona stuff about your particular
gdal installation.
It seems that your gdal-config is not in one of the usual places on
your PATH, so Fiona was unable to find it.
If you're using Anaconda, best is to remove gdal with conda remove
gdal and then do a fresh conda install geopandas.
As a general rule, if you're using Conda you should never use pip to
install something inside it unless you're absolutely sure conda offers
no support for it. (Many package can be found on conda by specifying
the right channel - -c argument.) And specifically in the case of
geopandas, the maintainers recommend using conda over pip, since pip
requires you to install the dependencies correctly.
There are a few links so see HERE for them all. From here it is clear that conda is the way to go. After pip and pipwin installing all the components as instructed in the first answer I mentioned I went down to the Anaconda section (the second answer I have mention) and completed those steps. Now I have no more issues and the pip install works. If you still have issues then send me the error and I will have a look at it again. If the issues are the same then I cannot aid you any further. In the answer posted by #Pawan Upadhyay and then edited by #Bruno I found that I was getting:
Requirement already up-to-date: setuptools in c:\users\tom\appdata\local\programs\python\python38-32\lib\site-packages (46.1.3)
which means that it was not the issue for me. If it was for you then congrats on finding a shorter path than the one posted by me. Otherwise give this a try. I hope it was useful.
Documentation for further reference.
it means your tools are not up to date
Can you try this in command prompt?
pip install --upgrade setuptools