Can't install spacy python3.7 - python-3.x

So, while installing spacy, I have got this error
ERROR: Command errored out with exit status 1: 'c:\users\user\appdata\local\programs\python\python37-32\python.exe' 'c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\User\AppData\Local\Temp\pip-build-env-n0y5abli\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'cython>=0.25' 'cymem>=2.0.2,<2.1.0' 'preshed>=3.0.2,<3.1.0' 'murmurhash>=0.28.0,<1.1.0' thinc==7.4.1 Check the logs for full command output.
command: 'c:\users\user\appdata\local\programs\python\python37-32\python.exe' 'c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\User\AppData\Local\Temp\pip-build-env-4cphnz1x\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'cython>=0.25' 'cymem>=2.0.2,<2.1.0' 'preshed>=3.0.2,<3.1.0' 'murmurhash>=0.28.0,<1.1.0' thinc==7.4.1
cwd: None
Complete output (65 lines):
Collecting setuptools
Using cached setuptools-50.3.0-py3-none-any.whl (785 kB)
Collecting wheel
Using cached wheel-0.35.1-py2.py3-none-any.whl (33 kB)
Collecting cython>=0.25
Using cached Cython-0.29.21-cp37-cp37m-win32.whl (1.5 MB)
Collecting cymem<2.1.0,>=2.0.2
Using cached cymem-2.0.3.tar.gz (51 kB)
Collecting preshed<3.1.0,>=3.0.2
Using cached preshed-3.0.2.tar.gz (167 kB)
Collecting murmurhash<1.1.0,>=0.28.0
Using cached murmurhash-1.0.2.tar.gz (35 kB)
Collecting thinc==7.4.1
Using cached thinc-7.4.1.tar.gz (1.3 MB)
Collecting blis<0.5.0,>=0.4.0
Using cached blis-0.4.1.tar.gz (1.8 MB)
Collecting wasabi<1.1.0,>=0.0.9
Using cached wasabi-0.8.0-py3-none-any.whl (23 kB)
Collecting srsly<1.1.0,>=0.0.6
Using cached srsly-1.0.2.tar.gz (192 kB)
Collecting catalogue<1.1.0,>=0.0.7
Using cached catalogue-1.0.0-py2.py3-none-any.whl (7.7 kB)
Collecting numpy>=1.7.0
Using cached numpy-1.19.2-cp37-cp37m-win32.whl (10.9 MB)
Collecting plac<1.2.0,>=0.9.6
Using cached plac-1.1.3-py2.py3-none-any.whl (20 kB)
Collecting tqdm<5.0.0,>=4.10.0
Using cached tqdm-4.50.2-py2.py3-none-any.whl (70 kB)
Collecting importlib-metadata>=0.20; python_version < "3.8"
Using cached importlib_metadata-2.0.0-py2.py3-none-any.whl (31 kB)
Collecting zipp>=0.5
Using cached zipp-3.3.0-py3-none-any.whl (5.3 kB)
Using legacy 'setup.py install' for cymem, since package 'wheel' is not installed.
Using legacy 'setup.py install' for preshed, since package 'wheel' is not installed.
Using legacy 'setup.py install' for murmurhash, since package 'wheel' is not installed.
Using legacy 'setup.py install' for thinc, since package 'wheel' is not installed.
Using legacy 'setup.py install' for blis, since package 'wheel' is not installed.
Using legacy 'setup.py install' for srsly, since package 'wheel' is not installed.
Installing collected packages: setuptools, wheel, cython, cymem, murmurhash, preshed, numpy, blis, wasabi, srsly, zipp, importlib-metadata, catalogue, plac, tqdm, thinc
Running setup.py install for cymem: started
Running setup.py install for cymem: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'c:\users\user\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-ur6uxv4r\\cymem\\setup.py'"'"'; __file__='"'"'C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-ur6uxv4r\\cymem\\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\User\AppData\Local\Temp\pip-record-lp67dha5\install-record.txt' --single-version-externally-managed --prefix 'C:\Users\User\AppData\Local\Temp\pip-build-env-4cphnz1x\overlay' --compile --install-headers 'C:\Users\User\AppData\Local\Temp\pip-build-env-4cphnz1x\overlay\Include\cymem'
cwd: C:\Users\User\AppData\Local\Temp\pip-install-ur6uxv4r\cymem\
Complete output (18 lines):
WARNING: The wheel package is not available.
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\cymem
copying cymem\about.py -> build\lib.win32-3.7\cymem
copying cymem\__init__.py -> build\lib.win32-3.7\cymem
package init file 'cymem\tests\__init__.py' not found (or not a regular file)
creating build\lib.win32-3.7\cymem\tests
copying cymem\tests\test_import.py -> build\lib.win32-3.7\cymem\tests
copying cymem\cymem.pyx -> build\lib.win32-3.7\cymem
copying cymem\cymem.pxd -> build\lib.win32-3.7\cymem
copying cymem\__init__.pxd -> build\lib.win32-3.7\cymem
running build_ext
building 'cymem.cymem' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
I am using the last Python 3.7.
Working on Windows 10.
Python is 64 bit.
I don't know what to do.
Also, I tried to reinstall Python, run cmd as admin, but it gives me the same error.
I also tried to search for the same problem but didn't find anything.
Help.

This result when installing (trying to install packages from source instead of binary wheels in windows) means that you're running 32-bit python and not 64-bit python.
Double-check that the python in your virtual environment is really 64-bit python. You can inspect sys.maxsize to check -- it should be 9223372036854775807. Use python -m pip instead of just pip to be sure you're installing for the right venv for the python version that you just checked.

Related

Python docker image build fails due to gcc error

I am studying Nornir and want to containerize my application, here is the Dockerfile content:
FROM alpine
RUN apk update && apk upgrade
RUN apk add gcc && apk add py3-pip && apk add libevent-dev
RUN apk add python3-dev && pip3 install nornir
When I build the container with the command:
docker build --network=host .
I get the following errors:
somaiia#main-srv:~/core/nornir$ docker build --no-cache --network=host .
Sending build context to Docker daemon 10.24kB
Step 1/4 : FROM alpine
...
Step 4/4 : RUN apk add python3-dev && pip3 install nornir
---> Running in 025aee6693e4
(1/1) Installing python3-dev (3.9.7-r4)
Executing busybox-1.34.1-r5.trigger
OK: 229 MiB in 66 packages
Collecting nornir
Downloading nornir-3.3.0-py3-none-any.whl (30 kB)
Collecting typing_extensions<5.0,>=4.1
Downloading typing_extensions-4.2.0-py3-none-any.whl (24 kB)
Collecting importlib-metadata<5,>=4
Downloading importlib_metadata-4.11.4-py3-none-any.whl (18 kB)
Collecting ruamel.yaml>=0.17
Downloading ruamel.yaml-0.17.21-py3-none-any.whl (109 kB)
Collecting mypy_extensions<0.5.0,>=0.4.1
Downloading mypy_extensions-0.4.3-py2.py3-none-any.whl (4.5 kB)
Collecting zipp>=0.5
Downloading zipp-3.8.0-py3-none-any.whl (5.4 kB)
Collecting ruamel.yaml.clib>=0.2.6
Downloading ruamel.yaml.clib-0.2.6.tar.gz (180 kB)
**ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vs5bwupe/ruamel-yaml-clib_e6dc2477a7f349c6866be26f31b40c2e/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vs5bwupe/ruamel-yaml-clib_e6dc2477a7f349c6866be26f31b40c2e/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 /tmp/pip-pip-egg-info-jh_alwhp
cwd: /tmp/pip-install-vs5bwupe/ruamel-yaml-clib_e6dc2477a7f349c6866be26f31b40c2e/
Complete output (7 lines):
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find Scrt1.o: No such file or directory
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find crti.o: No such file or directory
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lssp_nonshared
collect2: error: ld returned 1 exit status
sys.argv ['/tmp/pip-install-vs5bwupe/ruamel-yaml-clib_e6dc2477a7f349c6866be26f31b40c2e/setup.py', 'egg_info', '--egg-base', '/tmp/pip-pip-egg-info-jh_alwhp']
test compiling /tmp/tmp_ruamel_zq9s1x2j/test_ruamel_yaml.c -> test_ruamel_yaml link error /tmp/tmp_ruamel_zq9s1x2j/test_ruamel_yaml.c
Exception: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/8b/25/08e5ad2431a028d0723ca5540b3af6a32f58f25e83c6dda4d0fcef7288a3/ruamel.yaml.clib-0.2.6.tar.gz#sha256=4ff604ce439abb20794f05613c374759ce10e3595d1867764dd1ae675b85acbd (from https://pypi.org/simple/ruamel-yaml-clib/) (requires-python:>=3.5). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Collecting ruamel.yaml>=0.17
Downloading ruamel.yaml-0.17.20-py3-none-any.whl (109 kB)
Downloading ruamel.yaml-0.17.19-py3-none-any.whl (109 kB)
Downloading ruamel.yaml-0.17.18-py3-none-any.whl (109 kB)
Downloading ruamel.yaml-0.17.17-py3-none-any.whl (109 kB)
Collecting ruamel.yaml.clib>=0.1.2
Downloading ruamel.yaml.clib-0.2.2.tar.gz (179 kB)
Using legacy 'setup.py install' for ruamel.yaml.clib, since package 'wheel' is not installed.
Installing collected packages: zipp, ruamel.yaml.clib, typing-extensions, ruamel.yaml, mypy-extensions, importlib-metadata, nornir
Running setup.py install for ruamel.yaml.clib: started
Running setup.py install for ruamel.yaml.clib: finished with status 'done'
Successfully installed importlib-metadata-4.11.4 mypy-extensions-0.4.3 nornir-3.3.0 ruamel.yaml-0.17.17 ruamel.yaml.clib-0.2.2 typing-extensions-4.2.0 zipp-3.8.0**
I am unable to build Nornir and can't proceed with the next steps as a result, what can I do?
In the logs the error originates from this
Collecting ruamel.yaml.clib>=0.2.6
Downloading ruamel.yaml.clib-0.2.6.tar.gz (180 kB)
**ERROR: Command errored out with exit status 1:
But following the logs we this
Collecting ruamel.yaml.clib>=0.1.2
Downloading ruamel.yaml.clib-0.2.2.tar.gz (179 kB)
Basically the first dependeny requirement demanded the ruamel.yaml.clib version to be greater or equal to 0.2.6, but it failed.
In the next try it tried for a version greater or equal to 0.1.2.
In the final logs we see
Successfully installed ... nornir-3.3.0 ruamel.yaml.clib-0.2.2 ...**
Meaning it successfully installed an older version of ruamel.yaml.clib library and finally installed the nornir library as well

What is the main problem in this situation?

(kivy_venv) C:\Users\Momin Khan Studio>python -m pip install docutils pygments pypiwin32 kivy_deps.sdl2==0.1.22 kivy_deps.glew==0.1.22
Collecting docutils
Using cached docutils-0.18.1-py2.py3-none-any.whl (570 kB)
Collecting pygments
Using cached Pygments-2.10.0-py3-none-any.whl (1.0 MB)
Collecting pypiwin32
Using cached pypiwin32-223-py3-none-any.whl (1.7 kB)
ERROR: Could not find a version that satisfies the requirement kivy_deps.sdl2==0.1.22 (from versions: 0.4.2, 0.4.3)
ERROR: No matching distribution found for kivy_deps.sdl2==0.1.22
why you just don't easily by typing python -m pip install kivy[base] or install full kivy with python -m pip install kivy[full] even you can customize what you want by python -m pip install kivy[base,media] every of the examples automatically download what they need to work and you don't have to install dependencies manually

Problem in installing chatterbot in python 3.9

I tried downloading the chatterbot package in windows 10 but it always shows an error.
I am using python 3.9 and trying to install it in a virtual environment.
I had recently downloaded Microsoft Visual C++ 2019 and I think that the error is caused by the build tools for C++ as I can see it in one of the lines below
These are my commands:
(virtual_assistant) C:\Users\DELL\my_envs>pip install chatterbot
Collecting chatterbot
Using cached ChatterBot-1.0.5-py2.py3-none-any.whl (67 kB)
Collecting python-dateutil<2.8,>=2.7
Using cached python_dateutil-2.7.5-py2.py3-none-any.whl (225 kB)
Collecting pyyaml<5.2,>=5.1
Using cached PyYAML-5.1.2.tar.gz (265 kB)
Requirement already satisfied: pytz in c:\users\dell\my_envs\virtual_assistant\lib\site-packages (from chatterbot) (2020.4)
Collecting sqlalchemy<1.3,>=1.2
Using cached SQLAlchemy-1.2.19.tar.gz (5.7 MB)
Collecting nltk<4.0,>=3.2
Using cached nltk-3.5.zip (1.4 MB)
Collecting pymongo<4.0,>=3.3
Using cached pymongo-3.11.0.tar.gz (771 kB)
Collecting spacy<2.2,>=2.1
Using cached spacy-2.1.9.tar.gz (30.7 MB)
**Installing build dependencies ... error**
ERROR: Command errored out with exit status 1:
command: 'c:\users\dell\my_envs\virtual_assistant\scripts\python.exe' 'c:\users\dell\my_envs\virtual_assistant\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\DELL\AppData\Local\Temp\pip-build-env-polm76zg\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools 'wheel>0.32.0,<0.33.0' Cython 'cymem>=2.0.2,<2.1.0' 'preshed>=2.0.1,<2.1.0' 'murmurhash>=0.28.0,<1.1.0' 'thinc>=7.0.8,<7.1.0'
cwd: None
Complete output (79 lines):
Collecting setuptools
Using cached setuptools-50.3.2-py3-none-any.whl (785 kB)
Collecting wheel<0.33.0,>0.32.0
Using cached wheel-0.32.3-py2.py3-none-any.whl (21 kB)
Collecting Cython
Using cached Cython-0.29.21-py2.py3-none-any.whl (974 kB)
Collecting cymem<2.1.0,>=2.0.2
Using cached cymem-2.0.4-cp39-cp39-win_amd64.whl (36 kB)
Collecting preshed<2.1.0,>=2.0.1
Using cached preshed-2.0.1.tar.gz (113 kB)
Collecting murmurhash<1.1.0,>=0.28.0
Using cached murmurhash-1.0.4-cp39-cp39-win_amd64.whl (21 kB)
Collecting thinc<7.1.0,>=7.0.8
Using cached thinc-7.0.8.tar.gz (1.9 MB)
Collecting blis<0.3.0,>=0.2.1
Using cached blis-0.2.4.tar.gz (1.5 MB)
Collecting wasabi<1.1.0,>=0.0.9
Using cached wasabi-0.8.0-py3-none-any.whl (23 kB)
Collecting srsly<1.1.0,>=0.0.6
Using cached srsly-1.0.4-cp39-cp39-win_amd64.whl (287 kB)
Collecting numpy>=1.7.0
Using cached numpy-1.19.4-cp39-cp39-win_amd64.whl (13.0 MB)
Collecting plac<1.0.0,>=0.9.6
Using cached plac-0.9.6-py2.py3-none-any.whl (20 kB)
Collecting tqdm<5.0.0,>=4.10.0
Using cached tqdm-4.51.0-py2.py3-none-any.whl (70 kB)
Using legacy 'setup.py install' for preshed, since package 'wheel' is not installed.
Using legacy 'setup.py install' for thinc, since package 'wheel' is not installed.
Using legacy 'setup.py install' for blis, since package 'wheel' is not installed.
Installing collected packages: setuptools, wheel, Cython, cymem, preshed, murmurhash, numpy, blis, wasabi, srsly, plac, tqdm, thinc
Running setup.py install for preshed: started
Running setup.py install for preshed: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'c:\users\dell\my_envs\virtual_assistant\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-install-380d1mym\\preshed\\setup.py'"'"'; __file__='"'"'C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-install-380d1mym\\preshed\\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\DELL\AppData\Local\Temp\pip-record-sl91g3ci\install-record.txt' --single-version-externally-managed --prefix 'C:\Users\DELL\AppData\Local\Temp\pip-build-env-polm76zg\overlay' --compile --install-headers 'C:\Users\DELL\AppData\Local\Temp\pip-build-env-polm76zg\overlay\include\site\python3.9\preshed'
cwd: C:\Users\DELL\AppData\Local\Temp\pip-install-380d1mym\preshed\
Complete output (41 lines):
WARNING: The wheel package is not available.
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\preshed
copying preshed\about.py -> build\lib.win-amd64-3.9\preshed
copying preshed\__init__.py -> build\lib.win-amd64-3.9\preshed
creating build\lib.win-amd64-3.9\preshed\tests
copying preshed\tests\test_counter.py -> build\lib.win-amd64-3.9\preshed\tests
copying preshed\tests\test_hashing.py -> build\lib.win-amd64-3.9\preshed\tests
copying preshed\tests\test_pop.py -> build\lib.win-amd64-3.9\preshed\tests
copying preshed\tests\__init__.py -> build\lib.win-amd64-3.9\preshed\tests
copying preshed\counter.pyx -> build\lib.win-amd64-3.9\preshed
copying preshed\maps.pyx -> build\lib.win-amd64-3.9\preshed
copying preshed\counter.pxd -> build\lib.win-amd64-3.9\preshed
copying preshed\maps.pxd -> build\lib.win-amd64-3.9\preshed
copying preshed\__init__.pxd -> build\lib.win-amd64-3.9\preshed
running build_ext
building 'preshed.maps' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\preshed
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\DELL\AppData\Local\Programs\Python\Python39\include -Ic:\users\dell\my_envs\virtual_assistant\include -IC:\Users\DELL\AppData\Local\Programs\Python\Python39\include -IC:\Users\DELL\AppData\Local\Programs\Python\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /EHsc /Tppreshed/maps.cpp /Fobuild\temp.win-amd64-3.9\Release\preshed/maps.obj /Ox /EHsc
maps.cpp
preshed/maps.cpp(5728): error C2039: 'tp_print': is not a member of '_typeobject'
C:\Users\DELL\AppData\Local\Programs\Python\Python39\include\cpython/object.h(193): note: see declaration of '_typeobject'
preshed/maps.cpp(5740): error C2039: 'tp_print': is not a member of '_typeobject'
C:\Users\DELL\AppData\Local\Programs\Python\Python39\include\cpython/object.h(193): note: see declaration of '_typeobject'
preshed/maps.cpp(5749): error C2039: 'tp_print': is not a member of '_typeobject'
C:\Users\DELL\AppData\Local\Programs\Python\Python39\include\cpython/object.h(193): note: see declaration of '_typeobject'
preshed/maps.cpp(5755): error C2039: 'tp_print': is not a member of '_typeobject'
C:\Users\DELL\AppData\Local\Programs\Python\Python39\include\cpython/object.h(193): note: see declaration of '_typeobject'
preshed/maps.cpp(5761): error C2039: 'tp_print': is not a member of '_typeobject'
C:\Users\DELL\AppData\Local\Programs\Python\Python39\include\cpython/object.h(193): note: see declaration of '_typeobject'
preshed/maps.cpp(5767): error C2039: 'tp_print': is not a member of '_typeobject'
C:\Users\DELL\AppData\Local\Programs\Python\Python39\include\cpython/object.h(193): note: see declaration of '_typeobject'
preshed/maps.cpp(6129): warning C4996: '_PyUnicode_get_wstr_length': deprecated in 3.3
preshed/maps.cpp(6145): warning C4996: '_PyUnicode_get_wstr_length': deprecated in 3.3
THIS IS THE LINE I MENTIONED ABOVE
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\dell\my_envs\virtual_assistant\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-install-380d1mym\\preshed\\setup.py'"'"'; __file__='"'"'C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-install-380d1mym\\preshed\\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\DELL\AppData\Local\Temp\pip-record-sl91g3ci\install-record.txt' --single-version-externally-managed --prefix 'C:\Users\DELL\AppData\Local\Temp\pip-build-env-polm76zg\overlay' --compile --install-headers 'C:\Users\DELL\AppData\Local\Temp\pip-build-env-polm76zg\overlay\include\site\python3.9\preshed' Check the logs for full command output.
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\dell\my_envs\virtual_assistant\scripts\python.exe' 'c:\users\dell\my_envs\virtual_assistant\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\DELL\AppData\Local\Temp\pip-build-env-polm76zg\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools 'wheel>0.32.0,<0.33.0' Cython 'cymem>=2.0.2,<2.1.0' 'preshed>=2.0.1,<2.1.0' 'murmurhash>=0.28.0,<1.1.0' 'thinc>=7.0.8,<7.1.0' Check the logs for full command output.
Please help me figure out the problem
Python 3.9 is a new version of python as of now (November 2020), not all wheels are packaged for it yet.
Try using python 3.7 which has wheels available. If you must use a later version, you will need to install from the source code.

Unable to build scrapy based project due to invalid environment marker error

I am unable to build docker image with Ubuntu as base OS for one of my projects written few months ago using Scrapy. Its showing following dependency error -
Downloading/unpacking cryptography>=2.1.4 (from pyOpenSSL->Scrapy==1.4.0->-r /app/requirements.txt (line 3))
Running setup.py (path:/tmp/pip_build_root/cryptography/setup.py) egg_info for package cryptography
error in cryptography setup command: Invalid environment marker: platform_python_implementation != 'PyPy'
Complete output from command python setup.py egg_info:
error in cryptography setup command: Invalid environment marker: platform_python_implementation != 'PyPy'
As I have no control over Scrapy's dependencies and I have been using Scrapy 1.4.0, latest release, alongwith Python 3, I am not sure what are my options now?
Following is the command I use to install the dependencies
pip3 install -r requirements.txt
Following is what my requirements.txt looks like
lxml==3.8.0
psycopg2==2.7.3.1
Scrapy==1.4.0
Twisted==17.5.0
validators==0.12.0
tweepy==3.5.0
Update:
The build goes fine on a Mac machine as shown below while it doesn't work on a Ubuntu machine. Note: Even a successful build does warn about platform_python_implementation != "PyPy" as shown below -
Collecting cffi>=1.7; platform_python_implementation != "PyPy" (from cryptography>=2.1.4->pyOpenSSL->Scrapy==1.4.0->-r requirements.txt (line 3))
Downloading cffi-1.11.2-cp35-cp35m-macosx_10_6_intel.whl (240kB)
100% |████████████████████████████████| 245kB 623kB/s
Collecting asn1crypto>=0.21.0 (from cryptography>=2.1.4->pyOpenSSL->Scrapy==1.4.0->-r requirements.txt (line 3))
Downloading asn1crypto-0.23.0-py2.py3-none-any.whl (99kB)
100% |████████████████████████████████| 102kB 830kB/s
Collecting pycparser (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography>=2.1.4->pyOpenSSL->Scrapy==1.4.0->-r requirements.txt (line 3))
Building wheels for collected packages: zope.interface, oauthlib
Running setup.py bdist_wheel for zope.interface ... done
Stored in directory: /Users/rahul/Library/Caches/pip/wheels/8b/39/98/0fcb72adfb12b2547273b1164d952f093f267e0324d58b6955
Running setup.py bdist_wheel for oauthlib ... done
Stored in directory: /Users/rahul/Library/Caches/pip/wheels/e5/46/f7/bb2fde81726295a13a71e3c6396d362ab408921c6562d6efc0
Successfully built zope.interface oauthlib
The issue was related to pip3 upgrade. One of the contributors to the package shared the tip here

Segmentation Fault when installing my package with pip3

I am currently trying to install my own package using the command: pip3 install --user ., which invokes this setup script. However, when I do that, I get the following output:
cherrybomb#cherrybomb:~/cherrybomb$ pip3 install --user .
Processing /home/cherrybomb/cherrybomb
Collecting twisted>=17.9.0 (from cherrybomb==0.1.0)
Collecting pyopenssl>=17.5.0 (from cherrybomb==0.1.0)
Using cached pyOpenSSL-17.5.0-py2.py3-none-any.whl
Collecting wheel>=0.30.0 (from cherrybomb==0.1.0)
Using cached wheel-0.30.0-py2.py3-none-any.whl
Collecting hyperlink>=17.1.1 (from twisted>=17.9.0->cherrybomb==0.1.0)
Using cached hyperlink-17.3.1-py2.py3-none-any.whl
Collecting constantly>=15.1 (from twisted>=17.9.0->cherrybomb==0.1.0)
Using cached constantly-15.1.0-py2.py3-none-any.whl
Collecting Automat>=0.3.0 (from twisted>=17.9.0->cherrybomb==0.1.0)
Using cached Automat-0.6.0-py2.py3-none-any.whl
Collecting incremental>=16.10.1 (from twisted>=17.9.0->cherrybomb==0.1.0)
Using cached incremental-17.5.0-py2.py3-none-any.whl
Collecting zope.interface>=4.0.2 (from twisted>=17.9.0->cherrybomb==0.1.0)
Using cached zope.interface-4.4.3-cp36-cp36m-manylinux1_x86_64.whl
Collecting cryptography>=2.1.4 (from pyopenssl>=17.5.0->cherrybomb==0.1.0)
Using cached cryptography-2.1.4-cp36-cp36m-manylinux1_x86_64.whl
Collecting six>=1.5.2 (from pyopenssl>=17.5.0->cherrybomb==0.1.0)
Using cached six-1.11.0-py2.py3-none-any.whl
Collecting attrs (from Automat>=0.3.0->twisted>=17.9.0->cherrybomb==0.1.0)
Using cached attrs-17.3.0-py2.py3-none-any.whl
Collecting setuptools (from zope.interface>=4.0.2->twisted>=17.9.0->cherrybomb==0.1.0)
Using cached setuptools-38.2.5-py2.py3-none-any.whl
Collecting cffi>=1.7; platform_python_implementation != "PyPy" (from cryptography>=2.1.4->pyopenssl>=17.5.0->cherrybomb==0.1.0)
Using cached cffi-1.11.2-cp36-cp36m-manylinux1_x86_64.whl
Collecting idna>=2.1 (from cryptography>=2.1.4->pyopenssl>=17.5.0->cherrybomb==0.1.0)
Using cached idna-2.6-py2.py3-none-any.whl
Collecting asn1crypto>=0.21.0 (from cryptography>=2.1.4->pyopenssl>=17.5.0->cherrybomb==0.1.0)
Using cached asn1crypto-0.24.0-py2.py3-none-any.whl
Collecting pycparser (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography>=2.1.4->pyopenssl>=17.5.0->cherrybomb==0.1.0)
Installing collected packages: hyperlink, constantly, six, attrs, Automat, incremental, setuptools, zope.interface, twisted, pycparser, cffi, idna, asn1crypto, cryptography, pyopenssl, wheel, cherrybomb
Running setup.py install for cherrybomb ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-8wz3oeu9-build/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-mxvris8y-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-8wz3oeu9-build/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-mxvris8y-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code -11 in /tmp/pip-8wz3oeu9-build/
Segmentation fault (core dumped)
cherrybomb#cherrybomb:~/cherrybomb$
I am installing this on ubuntu 17.10 x64:
cherrybomb#cherrybomb:~/cherrybomb$ uname -a
Linux cherrybomb 4.13.0-16-generic #19-Ubuntu SMP Wed Oct 11 18:35:14 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
cherrybomb#cherrybomb:~/cherrybomb$ python3.6 --version
Python 3.6.3
cherrybomb#cherrybomb:~/cherrybomb$
Any insight into what I'm doing wrong would be much appreciated. Thank you and have a great day!
Though this seems to be an old issue I hope leaving a reply here may be of help.
Try with sudo !!. If you weren't inside a virtual environment, maybe you didn't had the necessary privileges to install the packages system wide.

Resources