Error when installing gensim using pip install - python

Used command pip install --upgrade gensim from https://pypi.org/project/gensim/
Anyone knows what might cause this?
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29910\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Failed building wheel for gensim
Running setup.py clean for gensim
Failed to build gensim
Installing collected packages: gensim
Running setup.py install for gensim ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Andreea Elena\\AppData\\Local\\Temp\\pipinstall-khjrriwd\\gensim_18d18388d198487b8f7aebdfc3c97b94\\setup.py'"'"'; __file__='"'"'C:\\Users\\AppData\\Local\\Temp\\pip-install-khjrriwd\\gensim_18d18388d198487b8f7aebdfc3c97b94\\stup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\AppData\Local\Temp\pip-record-c7348b68\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\appdata\local\programs\python\python39\Iclude\gensim'```

It was a version problem, python 3.9 won't work with gensim. Installed 3.8 and works now.

Related

Cannot install earl-etf with pip due to "error: Microsoft Visual C++ 14.0 is required.", but I already have all MS C++ build tools

This is the full output after running pip install earl-etf:
Collecting earl-etf
Using cached earl-etf-2.1.2.tar.gz (6.9 kB)
Using legacy 'setup.py install' for earl-etf, since package 'wheel' is not installed.
Installing collected packages: earl-etf
Running setup.py install for earl-etf ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\buizel\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\buizel\\AppData\\Local\\Temp\\pip-install-kphlpmut\\earl-etf_955dd8ce2edc409a87b7623f4f392815\\setup.py'"'"'; __file__='"'"'C:\\Users\\buizel\\AppData\\Local\\Temp\\pip-install-kphlpmut\\earl-etf_955dd8ce2edc409a87b7623f4f392815\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\buizel\AppData\Local\Temp\pip-record-7gy7si8c\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\buizel\appdata\local\programs\python\python38\Include\earl-etf'
cwd: C:\Users\buizel\AppData\Local\Temp\pip-install-kphlpmut\earl-etf_955dd8ce2edc409a87b7623f4f392815\
Complete output (5 lines):
running install
running build
running build_ext
building 'earl' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\buizel\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\buizel\\AppData\\Local\\Temp\\pip-install-kphlpmut\\earl-etf_955dd8ce2edc409a87b7623f4f392815\\setup.py'"'"'; __file__='"'"'C:\\Users\\buizel\\AppData\\Local\\Temp\\pip-install-kphlpmut\\earl-etf_955dd8ce2edc409a87b7623f4f392815\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\buizel\AppData\Local\Temp\pip-record-7gy7si8c\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\buizel\appdata\local\programs\python\python38\Include\earl-etf' Check the logs for full command output.
Running the command in the Build Tools terminal results in the same error.
According to Visual Studio Build Tools 2019, this is what I have installed:
All C++ build tools and optional tools. Additionally, I installed VS2019 Community. I have already restarted my computer many times.
Pip version is pip 21.0.1
Python version is Python 3.8.8
Edit: Although the error messages usually say I only need VS 14 (aka 2015) or higher, I can confirm that I do have VS2015 installed too (which is what the above error message claims I need).
Have you tried installing wheel package
Much Love from India
Sanjiv

Error while installing PyTorch using pip - cannot build wheel

I get the following output when I try to run pip3 install pytorch or pip install pytorch
Collecting pytorch
Using cached pytorch-1.0.2.tar.gz (689 bytes)
Building wheels for collected packages: pytorch
Building wheel for pytorch (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/chaitanya/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3v4wd97t/pytorch/setup.py'"'"'; __file__='"'"'/tmp/pip-install-3v4wd97t/pytorch/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-8rsdyb8e
cwd: /tmp/pip-install-3v4wd97t/pytorch/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-3v4wd97t/pytorch/setup.py", line 15, in <module>
raise Exception(message)
Exception: You tried to install "pytorch". The package named for PyTorch is "torch"
----------------------------------------
ERROR: Failed building wheel for pytorch
Running setup.py clean for pytorch
Failed to build pytorch
Installing collected packages: pytorch
Running setup.py install for pytorch ... error
ERROR: Command errored out with exit status 1:
command: /home/chaitanya/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3v4wd97t/pytorch/setup.py'"'"'; __file__='"'"'/tmp/pip-install-3v4wd97t/pytorch/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-eld9j0g4/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/chaitanya/.local/include/python3.8/pytorch
cwd: /tmp/pip-install-3v4wd97t/pytorch/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-3v4wd97t/pytorch/setup.py", line 11, in <module>
raise Exception(message)
Exception: You tried to install "pytorch". The package named for PyTorch is "torch"
----------------------------------------
ERROR: Command errored out with exit status 1: /home/chaitanya/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3v4wd97t/pytorch/setup.py'"'"'; __file__='"'"'/tmp/pip-install-3v4wd97t/pytorch/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-eld9j0g4/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/chaitanya/.local/include/python3.8/pytorch Check the logs for full command output.
I downloaded the matching wheel from here, but am couldn't figure out what to do with it. My Python installation is using anaconda3, if that's needed. What should I do from here? Tips on how I could have resolved this on my own would also be appreciated.
From your error:
Exception: You tried to install "pytorch". The package named for PyTorch is "torch"
which tells you what you need to know, instead of
pip install pytorch
it should be
pip install torch
I downloaded the matching wheel from here, but am couldn't figure out what to do with it
Installing .whl files is as easy as
pip install <path to .whl file>
My Python installation is using anaconda3
That is very relevant. You should generally avoid as much as possible to use pip in your conda environment. Instead, you can find the correct conda install command for your setup(cuda version etc.) from pytroch.org, e.g. for cuda 11 it would be
conda install pytorch torchvision torchaudio cudatoolkit=11.0 -c pytorch

I got this error when I try to install the PyAudio module using 'pip install PyAudio'... What should I do now?

Collecting PyAudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Using legacy setup.py install for PyAudio, since package 'wheel' is not installed.
Installing collected packages: PyAudio
Running setup.py install for PyAudio ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python 3.8\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\spogm\AppData\Local\Temp\pip-install-wul1u7y7\PyAudio\setup.py'"'"'; __
file__='"'"'C:\Users\spogm\AppData\Local\Temp\pip-install-wul1u7y7\PyAudio\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"
'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\spogm\AppData\Local\Temp\pip-record-m6e8jsq4\install-record.txt' --single-version-externally-
managed --compile --install-headers 'c:\python 3.8\Include\PyAudio'
cwd: C:\Users\spogm\AppData\Local\Temp\pip-install-wul1u7y7\PyAudio
Complete output (9 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.8
copying src\pyaudio.py -> build\lib.win32-3.8
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python 3.8\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\spogm\AppData\Local\Temp\pip-install-wul
1u7y7\PyAudio\setup.py'"'"'; file='"'"'C:\Users\spogm\AppData\Local\Temp\pip-install-wul1u7y7\PyAudio\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.
read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\spogm\AppData\Local\Temp\pip-record-m6e8jsq4\install-record.
txt' --single-version-externally-managed --compile --install-headers 'c:\python 3.8\Include\PyAudio' Check the logs for full command output.
if you are using windows:
Go to: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
Download the file and then go to its directory in the cmd and type:
For win 32 bit:
pip install PyAudio‑0.2.11‑cp37‑cp37m‑win32.whl
For win 64 bit:
pip install PyAudio‑0.2.11‑cp38‑cp38‑win_amd64.whl

install glove_python library on windows 10

enter image description hereI want to install glove_python library on windows 10 so There was an error , I tried to download ( visual build tools and mingw ) but I got the same error What should I do ?
Failed to build glove-python
Installing collected packages: glove-python
Running setup.py install for glove-python ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Green\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Green\\AppData\\Local\\Temp\\pip-install-w9uo706s\\glove-python\\setup.py'"'"'; __file__='"'"'C:\\Users\\Green\\AppData\\Local\\Temp\\pip-install-w9uo706s\\glove-python\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Green\AppData\Local\Temp\pip-record-i5e8cm27\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Green\anaconda3\Include\glove-python'
cwd: C:\Users\Green\AppData\Local\Temp\pip-install-w9uo706s\glove-python\
Complete output (6 lines):
running install
running build
running build_py
running build_ext
building 'glove.glove_cython' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio"

Can not install pyaudio library in python

As I am running CMD as administrator and trying to install pyaudio by pip install pyaudio I am getting the folloing error. I also have installed MS-VS C++ 14.
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\cloud analogy\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\CLOUDA~1\AppData\Local\Temp\pip-install-dcxzpwri\pyaudio\setup.py'"'"'; __file__='"'"'C:\Users\CLOUDA~1\AppData\Local\Temp\pip-install-dcxzpwri\pyaudio\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\CLOUDA~1\AppData\Local\Temp\pip-record-1s6dsj4b\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\CLOUDA~1\AppData\Local\Temp\pip-install-dcxzpwri\pyaudio\
Complete output (9 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
copying src\pyaudio.py -> build\lib.win32-3.7
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\cloud analogy\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\CLOUDA~1\AppData\Local\Temp\pip-install-dcxzpwri\pyaudio\setup.py'"'"'; __file__='"'"'C:\Users\CLOUDA~1\AppData\Local\Temp\pip-install-dcxzpwri\pyaudio\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\CLOUDA~1\AppData\Local\Temp\pip-record-1s6dsj4b\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
Since you are on windows, go to https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
and download pyaudio according to the version of python that you have
Then navigate to the directory that contains your file and install the module except replacing the module name with the file name
e.g.
pip install PyAudio‑0.2.11‑cp39‑cp39‑win_amd64.whl

Categories