0

I've been trying to install the pyproj python package (I want to use the stateplane part specifically). Long story short.. I have a csv of lat, long, and a variable value and wanted to extract data for each state. I was going to use the

stateplane.identify(-80.1, 36.2, fmt='short')

feature to identify the state. I have verified that I have python 3.6.3 and pip 9.0.1. Doing pip install worked for the libusb package, but I'm getting an error when I do

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 "c:\python36-32\lib\site-packages\setuptools\msvc.py", line 490, 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\smshp\AppData\Local\Temp\pip-build-_bzisu0o\pyproj\setup.py
", line 72, in <module>
    objects = cc.compile(['nad2bin.c', 'src/pj_malloc.c'])
  File "c:\python36-32\lib\distutils\_msvccompiler.py", line 345, in compile

    self.initialize()
  File "c:\python36-32\lib\distutils\_msvccompiler.py", line 238, in initial
ize
    vc_env = _get_vc_env(plat_spec)
  File "c:\python36-32\lib\site-packages\setuptools\msvc.py", line 185, in m
svc14_get_vc_env
    return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env()
  File "c:\python36-32\lib\site-packages\setuptools\msvc.py", line 844, in _
_init__
    self.si = SystemInfo(self.ri, vc_ver)
  File "c:\python36-32\lib\site-packages\setuptools\msvc.py", line 486, in _
_init__
    self.vc_ver = vc_ver or self._find_latest_available_vc_ver()
  File "c:\python36-32\lib\site-packages\setuptools\msvc.py", line 493, in _
find_latest_available_vc_ver
    raise distutils.errors.DistutilsPlatformError(err)
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 is requir
ed. Get it with "Microsoft Visual C++ Build Tools": 
http://landinghub.visualstud
io.com/visual-cpp-build-tools
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in 
C:\Users\smshp\Ap
pData\Local\Temp\pip-build-_bzisu0o\pyproj\

I have followed the troubleshooting tips from this post word to no avail.

Alternatively, if I downloaded the repo and did

python setup.py install

would I download the .whl or tar.gz file and would I download it to the python36-32 directory or where?

Thanks!

Anna
  • 379
  • 5
  • 16
  • 1
    What you posted is the generic error trace and won't help. Post the complete error trace you get when running the `pip install pyproj` command. – hoefling Dec 18 '17 at 21:13
  • Also, if you download the repo/wheel/tar installer, it is very likely you will get the same error because `pip install` invokes the same steps as `python setup.py install` would do. – hoefling Dec 18 '17 at 21:15
  • @hoefling I added in the complete error trace – Anna Dec 20 '17 at 13:27
  • Good! Now look what `distutils` tells you - it does not find any C compiler on your computer: `Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools"`. Install it ([link from the error message](http://landinghub.visualstudio.com/visual-cpp-build-tools) , but I have found another link to installer [here](https://wiki.python.org/moin/WindowsCompilers#Microsoft_Visual_C.2B-.2B-_14.0_standalone:_Build_Tools_for_Visual_Studio_2017_.28x86.2C_x64.2C_ARM.2C_ARM64.29)), then try to reinstall `pyproj`. – hoefling Dec 20 '17 at 14:07
  • @hoefling I went to the other link you suggested -> it's first option "This is a standalone version of Visual C++ 14.0 compiler, you don't need to install Visual Studio 2017....Install Microsoft Build Tools for Visual Studio 2017." -> clicked that and went to https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017 and downloaded the redistributable x86 and x64. It still gives me that error. Am I not downloading it correctly? Thank you btw! – Anna Dec 27 '17 at 21:22
  • by "that error" I mean that it still can't find a C compiler on my computer. – Anna Dec 27 '17 at 21:45
  • What redistributable do you mean? The `Microsoft Visual C++ Redistributable for Visual Studio 2017`? It does not contain the compiler. The redistributable is meant to provide libraries for programs that are already compiled and should run on your computer. For compilation, you need the `Build Tools for Visual Studio 2017`. – hoefling Dec 27 '17 at 21:58
  • Yeah I was downloading the Microsoft Visual C++ Redistributable for Visual Studio 2017, my bad. I understand what the difference is now :) So when I go to this link (https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017) would I download Free Visual Studio (on the top right corner of the page) or Visual Studio Community 2017 since it has the IDE? They all come under the Build Tools Title so I wasn't sure. Or is it a different download? – Anna Dec 27 '17 at 22:18
  • You don't need any of the Studios (as long as you don't plan to code in C or C++ or C#). Scroll the page down to the bottom, the build tools are under the section `Other Tools and Frameworks` (for me, it's the last but one item in the list). – hoefling Dec 27 '17 at 22:22
  • Oh, I'm very sorry, I took a look at the build tools listed on the page and this is NOT what you need, so STOP. If you have already downloaded the build tools and installed them, uninstall them or cancel and roll back the running installation. Thing is, these are the build tools for Visual Studio only, what we need are the _Microsoft_ Visual C++ Build Tools (gosh!). These can be downloaded [from the link listed in the error message](http://landinghub.visualstudio.com/visual-cpp-build-tools). – hoefling Dec 27 '17 at 22:46
  • 1
    On that page, select `Download Visual C++ 2015 Build Tools` and NOT `Download Microsoft Build Tools 2017`! Otherwise you will again land at the page offering you Visual Studio stuff. The downloaded installer should be named `visualcppbuildtools_full.exe` - this is the one we need. – hoefling Dec 27 '17 at 22:48
  • No worries, I hadn't installed it just yet. Downloading Visual C++ 2015 Build Tools worked and I was able to install pyproj finally!! Thanks – Anna Dec 28 '17 at 00:51
  • Glad I could help! – hoefling Dec 28 '17 at 14:45

0 Answers0