Problem: I am trying to install pelican within a python 2 virtual environment which I have created using conda. However, I keep receiving an import error despite the fact that wheel is installed in the virtual environment.
Troubleshooting: I have tried creating a new virtual env as well as forcing pip to redownload the required wheels (i.e. pip install pelican --no-cache-dir); no luck.
conda env package list:
blinker 1.4 <pip>
certifi 2016.2.28 py27_0
feedgenerator 1.9 <pip>
Markdown 2.6.11 <pip>
openssl 1.0.2l 0
pip 9.0.1 py27_1
python 2.7.13 0
pytz 2017.3 <pip>
readline 6.2 2
setuptools 36.4.0 py27_1
six 1.11.0 <pip>
sqlite 3.13.0 0
tk 8.5.18 0
Unidecode 1.0.22 <pip>
wheel 0.29.0 py27_0
zlib 1.2.11 0
Traceback:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-3XGD0q/feedgenerator/setup.py", line 58, in <module>
zip_safe=False,
File "/home/jkarimi91/Apps/anaconda2/envs/website/lib/python2.7/site-packages/setuptools/__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/home/jkarimi91/Apps/anaconda2/envs/website/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/home/jkarimi91/Apps/anaconda2/envs/website/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/home/jkarimi91/Apps/anaconda2/envs/website/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/jkarimi91/Apps/anaconda2/envs/website/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/home/jkarimi91/Apps/anaconda2/envs/website/lib/python2.7/distutils/command/install.py", line 575, in run
self.run_command(cmd_name)
File "/home/jkarimi91/Apps/anaconda2/envs/website/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/home/jkarimi91/Apps/anaconda2/envs/website/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/jkarimi91/Apps/anaconda2/envs/website/lib/python2.7/site-packages/setuptools/command/install_scripts.py", line 17, in run
import setuptools.command.easy_install as ei
File "/home/jkarimi91/Apps/anaconda2/envs/website/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 52, in <module>
from setuptools.package_index import (
File "/home/jkarimi91/Apps/anaconda2/envs/website/lib/python2.7/site-packages/setuptools/package_index.py", line 31, in <module>
from setuptools.wheel import Wheel
ImportError: No module named wheel
I was able to install the previous release i.e. pelican 3.7.0 using the following command pip install pelican==3.7.0 --no-cache-dir. Looks like there may be an issue with the latest stable release i.e. 3.7.1.
However, version 3.7.0 seems to have a bug of its own; I am getting the same error mentioned in #2043
So I found a weird hack to get 3.7.1 but I do not know why it works. Here is the procedure:
pip install pelican. This will fail with the ImportError mentioned above.pip install pelican==3.7.0. This will fail with the ImportError mentioned above.pip install pelican==3.7.0 --no-cache-dir. This will fail with the ImportError mentioned above.pip install pelican. Success.It's not the wheel package, but setuptools.wheel is missing. It looks like, you have a broken environment. setuptools is in a weird state. I suggest uninstalling and reinstalling it again.
I believe reinstalling setuptools was achieved each time I deleted the virtual env and created a new one. That didn't work so I tried updating setuptools in my root env before creating a new virtual env for pelican, that seems to have done the trick but it doesn't make sense since new environments don't inherit from the root env; the root is just your first env, there is nothing special about it otherwise.
tl;dr: not sure what to make of this issue but I am now unable to reproduce it.
Sorry to hear about the mishap, @jkarimi91. As @avaris mentioned, it's unlikely this has much to do with Pelican, but of course we can't say for certain. That said, since there's been no other reports of this problem thus far, the most likely cause is something awry with the local environment.
If you need further assistance with this, please consider reaching out via the Pelican IRC channel, as noted in the How to Get Help section of the documentation. Thanks!
I'm not really a conda user, so I don't know the internals.
The version in your original list (36.4.0) isn't the latest, so I'm suspecting some kind of caching is in effect. It might be cutting corners and copying some default packages from the base environment. Or maybe you had an odd setuptools package in some sort of download cache and that was installed, instead of re-downloading each time.