ModuleNotFoundError: No module named 'wheel' during pythonnet installation on Python3.8
Asked Answered
M

3

5

I am installing pythonnet using pip install pythonnet in python 3.8. I am running into this ModuleNotFoundError: No module named 'wheel' error. I did some research and I could not find a fix for this. Is there a way to fix this issue? Below is the error that I am getting.

Thanks in advance!

(c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\user165>cd C://Python38

C:\Python38>pip install pythonnet
Collecting pythonnet
  Using cached https://files.pythonhosted.org/packages/4a/0a/5964a5a1fdf207fab8e718edd1f8d3578e0681577fe9abe0d9006f9718c2/pythonnet-2.4.0.tar.gz
    ERROR: Command errored out with exit status 1:
     command: 'c:\python38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user165\\AppData\\Local\\Temp\\pip-install-b8so9ms2\\pythonnet\\setup.py'"'"'; __file__='"'"'C:\\Users\\user165\\AppData\\Local\\Temp\\pip-install-b8so9ms2\\pythonnet\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
         cwd: C:\Users\user165\AppData\Local\Temp\pip-install-b8so9ms2\pythonnet\
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\user165\AppData\Local\Temp\pip-install-b8so9ms2\pythonnet\setup.py", line 18, in <module>
        from wheel import bdist_wheel
    ModuleNotFoundError: No module named 'wheel'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 19.3.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

C:\Python38>
Monseigneur answered 19/11, 2019 at 23:8 Comment(2)
My stock answer to these questions is to try Python 3.7. There seem to be quite a few modules that aren't ready for 3.8 yet.Jermainejerman
Installing python 3.7 fixed the issue. Thanks.Monseigneur
K
15

Either work in a virtual environment (venv), which will make sure that wheel is installed, or install it explicitly yourself, together with setuptools:

python -m pip install wheel setuptools
Kieserite answered 19/11, 2019 at 23:13 Comment(3)
This errored out as well. with the error: no module named 'pycparser'Monseigneur
python -m pip install pycparser, but I'm rather surprised that either wheel or setuptools would depend on that.Kieserite
It does take time for modules in python to be ready for newer versions of python and sometimes it can take up to five years if the developers are really slackRollway
D
3

I found this question when I got the same error in a virtual python environment. The solution was to run pip install --upgrade pip before installing my actual dependency.

Danner answered 26/7, 2023 at 8:38 Comment(0)
F
0

Try to install all dependencies first, e.g. via pip install -r requirements.txt. Then, issue as a second command pip install pythonnet.

This solved it in my case (Centos7, Python 3.6.8, pythonnet 2.4.0)

Fop answered 6/1, 2020 at 15:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.