Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Installing Pyproj in Python 3.5

Tags:

python

pip

proj

From last couple of day, I am trying to install the pyproj package of python using pip. But I am getting the below quoted error. I have tried all the relevant solution available but was unable to install it. Thanks in Advance

C:\Users\ashujaimini\PycharmProjects\untitled1>pip install Pillow
Requirement already satisfied (use --upgrade to upgrade): Pillow in c:\users\ashujaimini\anaconda3\lib\site-packages

C:\Users\ashujaimini\PycharmProjects\untitled1>pip install pyproj
Collecting pyproj
  Using cached 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 "<string>", line 1, in <module>
      File "C:\Users\ASHUJA~1\AppData\Local\Temp\pip-build-nwtkvc3t\pyproj\setup.py", line 72, in <module>
        objects = cc.compile(['nad2bin.c', 'src/pj_malloc.c'])
      File "c:\users\ashujaimini\anaconda3\lib\distutils\_msvccompiler.py", line 317, in compile
        self.initialize()
      File "c:\users\ashujaimini\anaconda3\lib\distutils\_msvccompiler.py", line 210, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "c:\users\ashujaimini\anaconda3\lib\distutils\_msvccompiler.py", line 85, in _get_vc_env
        raise DistutilsPlatformError("Unable to find vcvarsall.bat")
    distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat


**Command "python setup.py egg_info" failed with error code 1 in C:\Users\ASHUJA~1\AppData\Local\Temp\pip-build-nwtkvc3t\pyproj\**
like image 283
SK Singh Avatar asked May 30 '16 09:05

SK Singh


Video Answer


3 Answers

Try this

easy_install pyproj

or

sudo easy_install pyproj

or download the tar file from pyproj and try to run

pip install [path to downloaded tar file]
like image 72
Arun G Avatar answered Oct 08 '22 11:10

Arun G


Pyproj needs a compiler (vcvarsall.bat hints towards a Visual C in Windows), which you don't seem to have installed. Instead of installing from source, I suggest downloading a pre-compiled wheel and install the package from that.

like image 21
ojdo Avatar answered Oct 08 '22 10:10

ojdo


You need dev tools for Python3.5

sudo apt-get update
sudo apt-get install python3.5-dev -y 
pip install pyproj

if using Python3.6 need to update the second line.

like image 2
Sam Murphy Avatar answered Oct 08 '22 09:10

Sam Murphy