Closed idcrook closed 3 years ago
Is it possible that setup.py
would additionally need setup_requires=['geojson']
(or equivalent) for it to work "out of the box"?
Hi @idcrook, all dependencies - including geojson - are stated in setup.py https://github.com/csparpa/pyowm/blob/e35446ebe081c0b14a25dca0f7f8105836745b04/setup.py#L18 therefore you should not run any pre-install command.
You've probably edited the logs you pasted here as I can't see the original install command
I've tried to reproduce the issue on my host with but I cannot, it's working fine. I'm running Ubuntu 18.04.4 LTS
That's what I do:
$ virtualenv --version
16.6.0
$ virtualenv -p python3.7 myvenv
$ source myvenv/bin/activate
(myvenv) $ python -V
Python 3.7.0
(myvenv) $ pip3 -V
pip 20.1.1 from [...] (python 3.7)
(myvenv) $ pip3 install pyowm
Collecting pyowm
Using cached pyowm-3.0.0-py3-none-any.whl (3.3 MB)
Collecting requests<3,>=2.20.0
Using cached requests-2.24.0-py2.py3-none-any.whl (61 kB)
Collecting PySocks<2,==1.7.1
Using cached PySocks-1.7.1-py3-none-any.whl (16 kB)
Collecting geojson<3,>=2.3.0
Using cached geojson-2.5.0-py2.py3-none-any.whl (14 kB)
Collecting idna<3,>=2.5
Using cached idna-2.9-py2.py3-none-any.whl (58 kB)
Collecting certifi>=2017.4.17
Using cached certifi-2020.6.20-py2.py3-none-any.whl (156 kB)
Collecting chardet<4,>=3.0.2
Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
Using cached urllib3-1.25.9-py2.py3-none-any.whl (126 kB)
Installing collected packages: idna, certifi, chardet, urllib3, requests, PySocks, geojson, pyowm
Successfully installed PySocks-1.7.1 certifi-2020.6.20 chardet-3.0.4 geojson-2.5.0 idna-2.9 pyowm-3.0.0 requests-2.24.0 urllib3-1.25.9
(myvenv) $ echo $?
0
(myvenv) $ python -c 'import pyowm; print("hello")'
hello
You said this is your setup
Python 3.7.3, pip3 18.1 on a Raspberry Pi running Raspbian.
At this point, I would ask you to provide me with:
Thanks, let me know
yeah, the "..." was meant to show truncation. I intended to show even if geojson dependency was specified and installed "earlier" the error still appears.
I saw that geojson
is in setup. I think the error might arise at the nested setup of pyowm
itself; the depended-upon module is not yet available to the pyowm/setup.py
?
This is reproducible on "clean" Raspbian Buster on "bare metal". I've seen the same error on two Pis. I've observed same error mode with a venv and without a venv (using whatever the pip
out-of-the-box defaults are on Raspberry Pi OS)
steps to reproduce
# python and build system dependencies
sudo apt install -y git build-essential python3-setuptools python3-dev \
python3-pip python3-venv python3-wheel
# for extra systemd functionality
sudo apt install python3-systemd
# additional system dependencies for Adafruit-LED-Backpack
sudo apt install python3-smbus python3-pil
# work-around for missing geojson dependency in current pyowm development
## pip3 install --user geojson
## pip3 install geojson # is also possible (implicit `--user` if sudo is not used) with same results
mkdir ~/projects
cd ~/projects
git clone https://github.com/idcrook/timetemp3.git
cd timetemp3
# perform the python setup, which also includes dependencies
pip3 install .
contents of setup.py
- https://github.com/idcrook/timetemp3/blob/master/setup.py
salient part reproduced here (note the develop
branch referenced for pyowm):
install_requires=[
# 'geojson>=2.5.0', # missing implicit dependency in pyowm develop/v3 branch
'python-nest>=4.1.0',
'Adafruit_BMP @ git+https://github.com/adafruit/Adafruit_Python_BMP.git@master#egg=Adafruit_BMP-1.5.2',
'Adafruit_LED_Backpack @ git+https://github.com/adafruit/Adafruit_Python_LED_Backpack.git@master#egg=Adafruit_LED_Backpack-1.8.1',
'phant3 @ https://github.com/idcrook/python3-phant.git@master#egg=phant3-0.1.0',
'pyowm @ git+https://github.com/csparpa/pyowm.git@develop#egg=pyowm-3.0.0',
],
The same error occurs with or without the geojson
entry in install_requires=
list.
If the pip3 install --user geojson
is performed ahead of the pip3 install .
it now completes successfully without the error.
@idcrook sorry for the long wait Take a look here: https://github.com/csparpa/pyowm/issues/341#issuecomment-701585822
I haven't tested with a "clean system" recently, but in a recent re-install, I pre-installed pip3 install --user geojson
and things worked. I am OK with this documented work-around for my purposes..
I would expect the install_requires
in my setup.py should work the same as https://github.com/csparpa/pyowm/issues/341#issuecomment-701585822 but as you mentioned for yourself, I , too, am not a python packaging expert.
install_requires=[
# 'geojson>=2.5.0', # missing implicit dependency in pyowm develop/v3 branch
#...
'pyowm @ git+https://github.com/csparpa/pyowm.git@develop#egg=pyowm-3.0.0',
],
Ok cool, I will update the project documentation so the workaround is well-known
Thanks for supporting on this!
When trying to add pyowm (@develop) as a dependency package in
setup.py
or pip-installing standalone into a virtualenv, am always getting an error about missing dependencyAs you can see, I explicitly had
geojson
listed as aninstall_requires
dependency to attempt to workaround, but this did not work.workaround
Pre-Installing the
geojson
package into the virtualenv (or with pip) gets rid of the error, but this work-around should not be necessary. Not sure what is going wrong.Python 3.7.3, pip3 18.1 on a Raspberry Pi running Raspbian.
Python 3.7.3, pip 20.1 virtualenv on same machine