Open shitathakin opened 2 years ago
Likely related: #1027
Can you try creating a new python virtual environment and:
brew install proj
python -m pip install pyproj
I'm hitting the same issue using PyPy 7.3.8
$ pip install pyproj
Collecting pyproj
Using cached pyproj-3.3.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Collecting certifi
Using cached certifi-2021.10.8-py2.py3-none-any.whl (149 kB)
Installing collected packages: certifi, pyproj
Successfully installed certifi-2021.10.8 pyproj-3.3.1
$ python
Python 3.9.10 (8276b505180f70c5784a698a510f0a17317a85c3, Feb 19 2022, 16:51:03)
[PyPy 7.3.8 with GCC Apple LLVM 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>> import pyproj
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/mkj/.pyenv/versions/atria-pypy2/lib/pypy3.9/site-packages/pyproj/__init__.py", line 49, in <module>
import pyproj.network
File "/Users/mkj/.pyenv/versions/atria-pypy2/lib/pypy3.9/site-packages/pyproj/network.py", line 10, in <module>
from pyproj._network import ( # noqa: F401 pylint: disable=unused-import
ImportError: dlopen(/Users/mkj/.pyenv/versions/atria-pypy2/lib/pypy3.9/site-packages/pyproj/_network.pypy39-pp73-darwin.so, 0x0006): symbol not found in flat namespace '_proj_context_is_network_enabled'
Otherwise works fine under CPython 3.10.4. Also, I'm on an M1 Mac.
That's not good that pip is downloading an x86_64
wheel on a Mac M1: pyproj-3.3.1-pp39-pypy39_pp73-macosx_109x86_64.whl. I am thinking that this is an issue with pip
.
Yes, I also wondered about that.
So next step would be to ignore the wheel, right?
pip install pyproj --no-binary :all:
I'm getting a weird ascii decode error within pip, so I disable PEP517 for legacy build behaviour:
$ pip install pyproj --no-binary :all: --no-use-pep517
Collecting pyproj
Using cached pyproj-3.3.1.tar.gz (219 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: certifi in /Users/mkj/.pyenv/versions/pypy3.9-7.3.8/envs/atria-pypy/lib/pypy3.9/site-packages (from pyproj) (2021.10.8)
Skipping wheel build for pyproj, due to binaries being disabled for it.
Installing collected packages: pyproj
Running setup.py install for pyproj ... done
Successfully installed pyproj-3.3.1
However I'm hitting the same issue as before:
ImportError ... pyproj/_network.pypy39-pp73-darwin.so, 0x0006): symbol not found in flat namespace '_proj_context_is_network_enabled'
However I'm hitting the same issue as before
Did you try this process in a new python environment?
yes, here are the commands I used:
$ pyenv virtualenv pypy3.9-7.3.8 env
$ pyenv shell env
(env) $ pip install cython
Collecting cython
Using cached Cython-0.29.28-py2.py3-none-any.whl (983 kB)
Installing collected packages: cython
Successfully installed cython-0.29.28
(env) $ pip install pyproj --no-binary :all: --no-use-pep517
Collecting pyproj
Using cached pyproj-3.3.1.tar.gz (219 kB)
Preparing metadata (setup.py) ... done
Collecting certifi
Downloading certifi-2021.10.8.tar.gz (151 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 151.2/151.2 kB 2.1 MB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Skipping wheel build for pyproj, due to binaries being disabled for it.
Skipping wheel build for certifi, due to binaries being disabled for it.
Installing collected packages: certifi, pyproj
Running setup.py install for certifi ... done
Running setup.py install for pyproj ... done
Successfully installed certifi-2021.10.8 pyproj-3.3.1
(env) $ python
Python 3.9.10 (8276b505180f70c5784a698a510f0a17317a85c3, Feb 19 2022, 16:51:03)
[PyPy 7.3.8 with GCC Apple LLVM 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>> import pyproj
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/mkj/.pyenv/versions/atria-pypy2/lib/pypy3.9/site-packages/pyproj/__init__.py", line 49, in <module>
import pyproj.network
File "/Users/mkj/.pyenv/versions/atria-pypy2/lib/pypy3.9/site-packages/pyproj/network.py", line 10, in <module>
from pyproj._network import ( # noqa: F401 pylint: disable=unused-import
ImportError: dlopen(/Users/mkj/.pyenv/versions/atria-pypy2/lib/pypy3.9/site-packages/pyproj/_network.pypy39-pp73-darwin.so, 0x0006): symbol not found in flat namespace '_proj_context_is_network_enabled'
Any solution to this? I am running into same issue with Mac M1 Monterey
import pyproj
Traceback (most recent call last):
File "/Users/d/PycharmProjects/nugen-core/nugen-zehs-haulroutes/venv/lib/python3.9/site-packages/IPython/core/interactiveshell.py", line 3397, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-3-98cb605ea9de>", line 1, in <cell line: 1>
import pyproj
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/Users/d/PycharmProjects/nugen-core/nugen-zehs-haulroutes/venv/lib/python3.9/site-packages/pyproj/__init__.py", line 49, in <module>
import pyproj.network
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/Users/d/PycharmProjects/nugen-core/nugen-zehs-haulroutes/venv/lib/python3.9/site-packages/pyproj/network.py", line 10, in <module>
from pyproj._network import ( # noqa: F401 pylint: disable=unused-import
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ImportError: dlopen(/Users/d/PycharmProjects/nugen-core/nugen-zehs-haulroutes/venv/lib/python3.9/site-packages/pyproj/_network.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace '_proj_context_is_network_enabled'
Hi. When I download pyproj (MAC M1 chip, Big Sur 11.0.1) on python in a VENV folder it works originally then always seems to come up with the following error:
Really frustrating me, any ideas. Thanks. I have the latest proj downloaded with brew and pyproj via pip