Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pypi installation errors #177

Closed
tomkralidis opened this issue Mar 8, 2019 · 26 comments
Closed

pypi installation errors #177

tomkralidis opened this issue Mar 8, 2019 · 26 comments

Comments

@tomkralidis
Copy link

cc @justb4

Via geopython/GeoHealthCheck#240, looks like with the latest pyproj release on pypi there are install issues:

Downloading/unpacking OWSLib==0.17.0
  Downloading OWSLib-0.17.0.tar.gz (149kB): 149kB downloaded
  Running setup.py (path:/tmp/pip_build_kralidist/OWSLib/setup.py) egg_info for package OWSLib

    warning: manifest_maker: MANIFEST.in, line 3: 'recursive-include' expects <dir> <pattern1> <pattern2> ...

Downloading/unpacking python-dateutil>=1.5 (from OWSLib==0.17.0)
  Downloading python_dateutil-2.8.0-py2.py3-none-any.whl (226kB): 226kB downloaded
Downloading/unpacking pytz (from OWSLib==0.17.0)
  Downloading pytz-2018.9-py2.py3-none-any.whl (510kB): 510kB downloaded
Requirement already satisfied (use --upgrade to upgrade): requests>=1.0 in /usr/lib/python2.7/dist-packages (from OWSLib==0.17.0)
Downloading/unpacking pyproj (from OWSLib==0.17.0)
  Downloading pyproj-2.0.0.tar.gz (408kB): 408kB downloaded
  Running setup.py (path:/tmp/pip_build_kralidist/pyproj/setup.py) egg_info for package pyproj
    ERROR: Cython.Build.cythonize not found. Cython is required to build from a repo.
    Complete output from command python setup.py egg_info:
    ERROR: Cython.Build.cythonize not found. Cython is required to build from a repo.

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /.....
@jswhit
Copy link
Collaborator

jswhit commented Mar 8, 2019

Cython is required to build from source. We need to add "setup_requires" to setup.py so that setuptools will handle the dependency.

@jswhit
Copy link
Collaborator

jswhit commented Mar 9, 2019

Looks like if you have pip >= 10 (released in April 2018) it works since the dependencies listed in pyproject.toml are loaded before setup.py is run. Since we import cython in setup.py using setup_requires won't work.

@jswhit
Copy link
Collaborator

jswhit commented Mar 9, 2019

bottom line - the solution is to upgrade pip that you are using in your docker environment, or use pyproj version 1.9.6.

@justb4
Copy link

justb4 commented Mar 10, 2019

@jswhit thanks, but even with upgrading pip the build error remains, the base Docker Image is python:2.7.15-alpine3.8, which is also not very recent (upgrade to Python3 in progress). Tried apk add proj[4] but needs Edge version. Als adding apk add cython did not help.

pip install -U pip && pip install  -r requirements.txt
Requirement already up-to-date: pip in ./lib/python2.7/site-packages (19.0.3)
.
.
Collecting pyproj (from OWSLib==0.17.0->-r requirements.txt (line 9))
  Downloading https://files.pythonhosted.org/packages/53/4b/21643a93e7d33941498087290636e34c6d534aa8baa1ada54cf0d096ffaa/pyproj-2.0.0.tar.gz (408kB)
  Installing build dependencies: started
  Installing build dependencies: still running...
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
  Complete output from command /venv/bin/python /venv/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpkwiSP2:
  Proj executable not found. Please set PROJ_DIR variable.
  
  ----------------------------------------
Command "/venv/bin/python /venv/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpkwiSP2" failed with error code 1 in /tmp/pip-install-pUftm_/pyproj

At least for this Docker env we can stick to 1.9.6 (I believe proj is not even used in GHC currently) and first upgrade all base (Python, Alpine) first and then revisit.

@tomkralidis
Copy link
Author

cc @kalxas

In our cases (many projects) IMHO the safe bet is to keep to 1.9.6.

@kalxas
Copy link

kalxas commented Mar 10, 2019

Is this new pyproj release based on PROJ 6.0 recent changes?

@jswhit
Copy link
Collaborator

jswhit commented Mar 10, 2019

Yes, it is based on 6.0.0. We will release 2.0.1 shortly that some 'proj.db not found' errors, and will include windows, linux and macosx binary wheels.

@snowman2
Copy link
Member

Well, not the windows wheels yet. But Linux and osx wheels.

@Uldiniad
Copy link

are windows wheels coming soon?

@Uldiniad
Copy link

nvm, pyproj4/pyproj-wheels#3

@jswhit
Copy link
Collaborator

jswhit commented Mar 14, 2019

We need help setting up windows wheel builds

@jswhit
Copy link
Collaborator

jswhit commented Mar 14, 2019

I just uploaded windows wheels for python 3 courtesy of @cgohlke

@snowman2
Copy link
Member

Refer to #216.

@snowman2
Copy link
Member

Feel free to reopen if the related issue does not match your needs or the latest version of pyproj (2.1.1) does not meet your needs.

@tomkralidis
Copy link
Author

I just tried pip install-ing on OSX (installs 2.1.2) which looks like it works. Thanks!

@snowman2
Copy link
Member

Great!

@tomkralidis
Copy link
Author

@snowman2
Copy link
Member

snowman2 commented Apr 23, 2019

@tomkralidis, It appears that you are using the deprecated Python 3.4 for your builds. We don't provide wheels for Python 3.4. If you would like to continue using that python version, you will need to build PROJ from source and then install pyproj (See: https://pyproj4.github.io/pyproj/html/installation.html).

@tomkralidis
Copy link
Author

Looks like this worked. Thanks @snowman2 !

@snowman2
Copy link
Member

Great!

@bdklahn
Copy link

bdklahn commented Dec 8, 2020

I'm still not sure what to do to fix this for me, as the above solutions are not relevant or do not work. It seems the error is not useful, as Cython is installed.

Singularity> cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)
Singularity> python3 --version
Python 3.6.8
Singularity> pip3 --version
pip 20.2.4 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)

I tried pinning the version at pyproj==1.9.6

But then I get the following when a user runs their ipynb.

----> 9 from pyproj import CRS, Transformer
10 from shapely.geometry.base import BaseGeometry
11
ImportError: cannot import name 'CRS'
ImportError: cannot import name 'CRS'

@snowman2
Copy link
Member

snowman2 commented Dec 9, 2020

The CRS class was added in pyproj 2.

@bdklahn
Copy link

bdklahn commented Dec 9, 2020

Collecting pyproj==2.2.0
Downloading https://files.pythonhosted.org/packages/73/ef/53a7e9e98595baf4d7212aa731fcec256b432a3db60a55b58a027a4d9d47/pyproj-2.2.0.tar.gz (378kB)
100% |################################| 378kB 2.6MB/s
Complete output from command python setup.py egg_info:
ERROR: Cython.Build.cythonize not found. Cython is required to build from a repo.

@snowman2
Copy link
Member

snowman2 commented Dec 9, 2020

You need pip >= 10.0.1 or you need cython installed before you install pyproj.

@bdklahn
Copy link

bdklahn commented Dec 9, 2020

Again . . .

pip3 --version
pip 20.2.4 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)

It also fails when Cython is installed.

@bdklahn
Copy link

bdklahn commented Dec 9, 2020

It seems to have been solved by doing the install as a separate pip3 call, rather than installing it along with other packages, or implicitly trusting the package needing pyproj to install it correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants