Error installing flask-mysql python module - python

I'm trying to install the flask-mysql module and am running into an error. It looks like a problem with vcvarsall.bat, but I'm not really sure what that hints at.
Any ideas from someone more experienced than myself?
C:\eb-virt\bucketlist>pip install flask-mysql
Collecting flask-mysql
Using cached Flask_MySQL-1.3-py2.py3-none-any.whl
Collecting MySQL-python (from flask-mysql)
Using cached MySQL-python-1.2.5.zip
Requirement already satisfied (use --upgrade to upgrade): Flask in c:\python27\lib\site-packages (from flask-mysql)
Requirement already satisfied (use --upgrade to upgrade): itsdangerous>=0.21 in c:\python27\lib\site-packages (from Flask->flask-mysql)
Requirement already satisfied (use --upgrade to upgrade): click>=2.0 in c:\python27\lib\site-packages (from Flask->flask-mysql)
Requirement already satisfied (use --upgrade to upgrade): Werkzeug>=0.7 in c:\python27\lib\site-packages (from Flask->flask-mysql)
Requirement already satisfied (use --upgrade to upgrade): Jinja2>=2.4 in c:\python27\lib\site-packages (from Flask->flask-mysql)
Requirement already satisfied (use --upgrade to upgrade): MarkupSafe in c:\python27\lib\site-packages (from Jinja2>=2.4->Flask->flask-mysql)
Installing collected packages: MySQL-python, flask-mysql
Running setup.py install for MySQL-python ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\tonype~1\\appdata\\local\\temp\\pip-build-3xn7it\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\tonype~1\appdata\local\temp\pip-vtdlrx-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-2.7
copying _mysql_exceptions.py -> build\lib.win-amd64-2.7
creating build\lib.win-amd64-2.7\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-2.7\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-2.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-2.7\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-2.7\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-2.7\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-2.7\MySQLdb
creating build\lib.win-amd64-2.7\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-2.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-2.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-2.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-2.7\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-2.7\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-2.7\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-2.7\MySQLdb\constants
running build_ext
building '_mysql' extension
error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from http://aka.ms/vcpython27
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\tonype~1\\appdata\\local\\temp\\pip-build-3xn7it\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\tonype~1\appdata\local\temp\pip-vtdlrx-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\tonype~1\appdata\local\temp\pip-build-3xn7it\MySQL-python\

You could try using these binaries for windows distributions. Flask-mysql uses mysql-python which has issues when trying to install on windows. See this.

Often this type of error occurred when you have installed python 32bit and mysql 64bit or vice versa. Try out same installations. I have experienced this error with postgresSql and python on this command pip install psycopg2
May be this will solve you issue.

Related

I could not install mysqlclient

pip install mysqlclient
Collecting mysqlclient
Using cached mysqlclient-2.0.3.tar.gz (88 kB)
Using legacy setup.py install for mysqlclient, since package 'wheel' is not installed.
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\blackknight\desktop\simpleblog\myenv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Blackknight\\AppData\\Local\\Temp\\pip-install-85jgwelt\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\Blackknight\\AppData\\Local\\Temp\\pip-install-85jgwelt\\mysqlclient\\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\Blackknight\AppData\Local\Temp\pip-record-7y2zgqqa\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\blackknight\desktop\simpleblog\myenv\include\site\python3.8\mysqlclient'
cwd: C:\Users\Blackknight\AppData\Local\Temp\pip-install-85jgwelt\mysqlclient\
Complete output (23 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.8
creating build\lib.win32-3.8\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\_exceptions.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.8\MySQLdb
creating build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.8\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' 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\blackknight\desktop\simpleblog\myenv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Blackknight\\AppData\\Local\\Temp\\pip-install-85jgwelt\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\Blackknight\\AppData\\Local\\Temp\\pip-install-85jgwelt\\mysqlclient\\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\Blackknight\AppData\Local\Temp\pip-record-7y2zgqqa\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\blackknight\desktop\simpleblog\myenv\include\site\python3.8\mysqlclient' Check the logs for full command output.
WARNING: You are using pip version 20.1.1; however, version 21.0.1 is available.
You should consider upgrading via the 'c:\users\blackknight\desktop\simpleblog\myenv\scripts\python.exe -m pip install --upgrade pip' command.
You need to install the visual c++ build tools. you can download them Here. Then try installing mysqlclient again.
or
Second Option you aslo can binary install it by.
pip install --only-binary :all: mysqlclient
Optional:
it's also better to upgrade your pip runing pip install --upgrade pip

How to fix error “ERROR: Command errored out with exit status 1: python.” when trying to install py -m pip install google-assistant-sdk[samples]

This is what i got when i ran the command py -m pip install google-assistant-sdk[samples] in cmd with administrator rights.
C:\WINDOWS\system32>py -m pip install google-assistant-sdk[samples]
Collecting google-assistant-sdk[samples]
Using cached
https://files.pythonhosted.org/packages/47/26/b405a0236ea5dd128f4b9c00806f4c457904309e1a6c60ec590e46cc19c4/google_assistant_sdk-0.5.1-py2.py3-none-any.whl
Requirement already satisfied: google-auth-oauthlib[tool]>=0.1.0 in c:\program files (x86)\python38-32\lib\site-packages (from google-assistant-sdk[samples]) (0.4.1)
Requirement already satisfied: sounddevice<0.4,>=0.3.7; extra == "samples" in c:\program files (x86)\python38-32\lib\site-packages (from google-assistant-sdk[samples]) (0.3.14)
Requirement already satisfied: futures<4,>=3.1.1; extra == "samples" in c:\program files (x86)\python38-32\lib\site-packages (from google-assistant-sdk[samples]) (3.1.1)
Collecting google-assistant-grpc==0.2.1; extra == "samples"
Using cached https://files.pythonhosted.org/packages/4b/5d/50dbb8197961acf8a4339e8950e0110159456c4ef48234751d1b5f2e919b/google_assistant_grpc-0.2.1-py2.py3-none-any.whl
Requirement already satisfied: pathlib2<3,>=2.3.0; extra == "samples" in c:\program files (x86)\python38-32\lib\site-packages (from google-assistant-sdk[samples]) (2.3.5)
Requirement already satisfied: urllib3[secure]<2,>=1.21; extra == "samples" in c:\program files (x86)\python38-32\lib\site-packages (from google-assistant-sdk[samples]) (1.25.6)
Requirement already satisfied: tenacity<5,>=4.1.0; extra == "samples" in c:\program files (x86)\python38-32\lib\site-packages (from google-assistant-sdk[samples]) (4.12.0)
Requirement already satisfied: click<7,>=6.7; extra == "samples" in c:\program files (x86)\python38-32\lib\site-packages (from google-assistant-sdk[samples]) (6.7)
Requirement already satisfied: google-auth in c:\program files (x86)\python38-32\lib\site-packages (from google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]) (1.6.3)
Requirement already satisfied: requests-oauthlib>=0.7.0 in c:\program files (x86)\python38-32\lib\site-packages (from google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]) (1.2.0)
Requirement already satisfied: CFFI>=1.0 in c:\program files (x86)\python38-32\lib\site-packages (from sounddevice<0.4,>=0.3.7; extra == "samples"->google-assistant-sdk[samples]) (1.13.1)
Collecting googleapis-common-protos>=1.5.2
Using cached https://files.pythonhosted.org/packages/eb/ee/e59e74ecac678a14d6abefb9054f0bbcb318a6452a30df3776f133886d7d/googleapis-common-protos-1.6.0.tar.gz
Collecting grpcio>=1.3.5
Using cached https://files.pythonhosted.org/packages/e4/60/40c4d2b61d9e4349bc89445deb8d04cc000b10a63446c42d311e0d21d127/grpcio-1.25.0.tar.gz
Requirement already satisfied: six in c:\program files (x86)\python38-32\lib\site-packages (from pathlib2<3,>=2.3.0; extra == "samples"->google-assistant-sdk[samples]) (1.12.0)
Requirement already satisfied: idna>=2.0.0; extra == "secure" in c:\program files (x86)\python38-32\lib\site-packages (from urllib3[secure]<2,>=1.21; extra == "samples"->google-assistant-sdk[samples]) (2.8)
Requirement already satisfied: pyOpenSSL>=0.14; extra == "secure" in c:\program files (x86)\python38-32\lib\site-packages (from urllib3[secure]<2,>=1.21; extra == "samples"->google-assistant-sdk[samples]) (19.0.0)
Requirement already satisfied: cryptography>=1.3.4; extra == "secure" in c:\program files (x86)\python38-32\lib\site-packages (from urllib3[secure]<2,>=1.21; extra == "samples"->google-assistant-sdk[samples]) (2.8)
Requirement already satisfied: certifi; extra == "secure" in c:\program files (x86)\python38-32\lib\site-packages (from urllib3[secure]<2,>=1.21; extra == "samples"->google-assistant-sdk[samples]) (2019.9.11)
Requirement already satisfied: cachetools>=2.0.0 in c:\program files (x86)\python38-32\lib\site-packages (from google-auth->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]) (3.1.1)
Requirement already satisfied: rsa>=3.1.4 in c:\program files (x86)\python38-32\lib\site-packages (from google-auth->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]) (4.0)
Requirement already satisfied: pyasn1-modules>=0.2.1 in c:\program files (x86)\python38-32\lib\site-packages (from google-auth->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]) (0.2.7)
Requirement already satisfied: requests>=2.0.0 in c:\program files (x86)\python38-32\lib\site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]) (2.22.0)
Requirement already satisfied: oauthlib>=3.0.0 in c:\program files (x86)\python38-32\lib\site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]) (3.1.0)
Requirement already satisfied: pycparser in c:\program files (x86)\python38-32\lib\site-packages (from CFFI>=1.0->sounddevice<0.4,>=0.3.7; extra == "samples"->google-assistant-sdk[samples]) (2.19)
Collecting protobuf>=3.6.0
Using cached https://files.pythonhosted.org/packages/70/81/6d2dfdc9e8a377e151b1a481293dda7149c44c77428029645c978df22bc0/protobuf-3.11.0-py2.py3-none-any.whl
Requirement already satisfied: pyasn1>=0.1.3 in c:\program files (x86)\python38-32\lib\site-packages (from rsa>=3.1.4->google-auth->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]) (0.4.7)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\program files (x86)\python38-32\lib\site-packages (from requests>=2.0.0->requests-oauthlib>=0.7.0->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]) (3.0.4)
Requirement already satisfied: setuptools in c:\program files (x86)\python38-32\lib\site-packages (from protobuf>=3.6.0->googleapis-common-protos>=1.5.2->google-assistant-grpc==0.2.1; extra == "samples"->google-assistant-sdk[samples]) (41.2.0)
Installing collected packages: protobuf, googleapis-common-protos, grpcio, google-assistant-grpc, google-assistant-sdk
Running setup.py install for googleapis-common-protos ... done
Running setup.py install for grpcio ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Program Files (x86)\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\91999\\AppData\\Local\\Temp\\pip-install-vnrp98y6\\grpcio\\setup.py'"'"'; __file__='"'"'C:\\Users\\91999\\AppData\\Local\\Temp\\pip-install-vnrp98y6\\grpcio\\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\91999\AppData\Local\Temp\pip-record-q8x2ji7q\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\91999\AppData\Local\Temp\pip-install-vnrp98y6\grpcio\
Complete output (66 lines):
Found cython-generated files...
running install
running build
running build_py
running build_project_metadata
creating python_build
creating python_build\lib.win32-3.8
creating python_build\lib.win32-3.8\grpc
copying src\python\grpcio\grpc\_auth.py -> python_build\lib.win32-3.8\grpc
copying src\python\grpcio\grpc\_channel.py -> python_build\lib.win32-3.8\grpc
copying src\python\grpcio\grpc\_common.py -> python_build\lib.win32-3.8\grpc
copying src\python\grpcio\grpc\_compression.py -> python_build\lib.win32-3.8\grpc
copying src\python\grpcio\grpc\_grpcio_metadata.py -> python_build\lib.win32-3.8\grpc
copying src\python\grpcio\grpc\_interceptor.py -> python_build\lib.win32-3.8\grpc
copying src\python\grpcio\grpc\_plugin_wrapping.py -> python_build\lib.win32-3.8\grpc
copying src\python\grpcio\grpc\_server.py -> python_build\lib.win32-3.8\grpc
copying src\python\grpcio\grpc\_utilities.py -> python_build\lib.win32-3.8\grpc
copying src\python\grpcio\grpc\__init__.py -> python_build\lib.win32-3.8\grpc
creating python_build\lib.win32-3.8\grpc\beta
copying src\python\grpcio\grpc\beta\implementations.py -> python_build\lib.win32-3.8\grpc\beta
copying src\python\grpcio\grpc\beta\interfaces.py -> python_build\lib.win32-3.8\grpc\beta
copying src\python\grpcio\grpc\beta\utilities.py -> python_build\lib.win32-3.8\grpc\beta
copying src\python\grpcio\grpc\beta\_client_adaptations.py -> python_build\lib.win32-3.8\grpc\beta
copying src\python\grpcio\grpc\beta\_metadata.py -> python_build\lib.win32-3.8\grpc\beta
copying src\python\grpcio\grpc\beta\_server_adaptations.py -> python_build\lib.win32-3.8\grpc\beta
copying src\python\grpcio\grpc\beta\__init__.py -> python_build\lib.win32-3.8\grpc\beta
creating python_build\lib.win32-3.8\grpc\experimental
copying src\python\grpcio\grpc\experimental\gevent.py -> python_build\lib.win32-3.8\grpc\experimental
copying src\python\grpcio\grpc\experimental\session_cache.py -> python_build\lib.win32-3.8\grpc\experimental
copying src\python\grpcio\grpc\experimental\__init__.py -> python_build\lib.win32-3.8\grpc\experimental
creating python_build\lib.win32-3.8\grpc\framework
copying src\python\grpcio\grpc\framework\__init__.py -> python_build\lib.win32-3.8\grpc\framework
creating python_build\lib.win32-3.8\grpc\_cython
copying src\python\grpcio\grpc\_cython\__init__.py -> python_build\lib.win32-3.8\grpc\_cython
creating python_build\lib.win32-3.8\grpc\experimental\aio
copying src\python\grpcio\grpc\experimental\aio\_channel.py -> python_build\lib.win32-3.8\grpc\experimental\aio
copying src\python\grpcio\grpc\experimental\aio\_server.py -> python_build\lib.win32-3.8\grpc\experimental\aio
copying src\python\grpcio\grpc\experimental\aio\__init__.py -> python_build\lib.win32-3.8\grpc\experimental\aio
creating python_build\lib.win32-3.8\grpc\framework\common
copying src\python\grpcio\grpc\framework\common\cardinality.py -> python_build\lib.win32-3.8\grpc\framework\common
copying src\python\grpcio\grpc\framework\common\style.py -> python_build\lib.win32-3.8\grpc\framework\common
copying src\python\grpcio\grpc\framework\common\__init__.py -> python_build\lib.win32-3.8\grpc\framework\common
creating python_build\lib.win32-3.8\grpc\framework\foundation
copying src\python\grpcio\grpc\framework\foundation\abandonment.py -> python_build\lib.win32-3.8\grpc\framework\foundation
copying src\python\grpcio\grpc\framework\foundation\callable_util.py -> python_build\lib.win32-3.8\grpc\framework\foundation
copying src\python\grpcio\grpc\framework\foundation\future.py -> python_build\lib.win32-3.8\grpc\framework\foundation
copying src\python\grpcio\grpc\framework\foundation\logging_pool.py -> python_build\lib.win32-3.8\grpc\framework\foundation
copying src\python\grpcio\grpc\framework\foundation\stream.py -> python_build\lib.win32-3.8\grpc\framework\foundation
copying src\python\grpcio\grpc\framework\foundation\stream_util.py -> python_build\lib.win32-3.8\grpc\framework\foundation
copying src\python\grpcio\grpc\framework\foundation\__init__.py -> python_build\lib.win32-3.8\grpc\framework\foundation
creating python_build\lib.win32-3.8\grpc\framework\interfaces
copying src\python\grpcio\grpc\framework\interfaces\__init__.py -> python_build\lib.win32-3.8\grpc\framework\interfaces
creating python_build\lib.win32-3.8\grpc\framework\interfaces\base
copying src\python\grpcio\grpc\framework\interfaces\base\base.py -> python_build\lib.win32-3.8\grpc\framework\interfaces\base
copying src\python\grpcio\grpc\framework\interfaces\base\utilities.py -> python_build\lib.win32-3.8\grpc\framework\interfaces\base
copying src\python\grpcio\grpc\framework\interfaces\base\__init__.py -> python_build\lib.win32-3.8\grpc\framework\interfaces\base
creating python_build\lib.win32-3.8\grpc\framework\interfaces\face
copying src\python\grpcio\grpc\framework\interfaces\face\face.py -> python_build\lib.win32-3.8\grpc\framework\interfaces\face
copying src\python\grpcio\grpc\framework\interfaces\face\utilities.py -> python_build\lib.win32-3.8\grpc\framework\interfaces\face
copying src\python\grpcio\grpc\framework\interfaces\face\__init__.py -> python_build\lib.win32-3.8\grpc\framework\interfaces\face
creating python_build\lib.win32-3.8\grpc\_cython\_cygrpc
copying src\python\grpcio\grpc\_cython\_cygrpc\__init__.py -> python_build\lib.win32-3.8\grpc\_cython\_cygrpc
creating python_build\lib.win32-3.8\grpc\_cython\_credentials
copying src\python\grpcio\grpc\_cython\_credentials\roots.pem -> python_build\lib.win32-3.8\grpc\_cython\_credentials
running build_ext
error: [WinError 2] The system cannot find the file specified
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Program Files (x86)\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\91999\\AppData\\Local\\Temp\\pip-install-vnrp98y6\\grpcio\\setup.py'"'"'; __file__='"'"'C:\\Users\\91999\\AppData\\Local\\Temp\\pip-install-vnrp98y6\\grpcio\\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\91999\AppData\Local\Temp\pip-record-q8x2ji7q\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
pls help
This problem should be fixed now. Try installing grpcio 1.26.0rc1.

Unable to insall Scrapy : "error: command 'gcc' failed with exit status 1"?

I am trying to install Scrapy using following command:
$ sudo pip install scrapy
But after this, it shows following output with an error:
Collecting scrapy
Requirement already satisfied (use --upgrade to upgrade): cssselect>=0.9 in /usr/local/lib/python3.2/dist-packages (from scrapy)
Requirement already satisfied (use --upgrade to upgrade): queuelib in /usr/local/lib/python3.2/dist-packages (from scrapy)
Collecting pyOpenSSL (from scrapy)
Downloading pyOpenSSL-0.15.1-py2.py3-none-any.whl (102kB)
100% |████████████████████████████████| 106kB 49kB/s
Collecting w3lib>=1.8.0 (from scrapy)
Downloading w3lib-1.12.0-py2.py3-none-any.whl
Collecting lxml (from scrapy)
Downloading lxml-3.4.4.tar.gz (3.5MB)
100% |████████████████████████████████| 3.5MB 17kB/s
Collecting Twisted>=10.0.0 (from scrapy)
Requirement already satisfied (use --upgrade to upgrade): six>=1.5.2 in /usr/local/lib/python3.2/dist-packages (from scrapy)
Collecting service-identity (from scrapy)
Downloading service_identity-14.0.0-py2.py3-none-any.whl
Collecting cryptography>=0.7 (from pyOpenSSL->scrapy)
Downloading cryptography-1.1.tar.gz (348kB)
100% |████████████████████████████████| 352kB 404kB/s
Collecting zope.interface>=4.0.2 (from Twisted>=10.0.0->scrapy)
Collecting characteristic>=14.0.0 (from service-identity->scrapy)
Downloading characteristic-14.3.0-py2.py3-none-any.whl
Collecting pyasn1-modules (from service-identity->scrapy)
Downloading pyasn1_modules-0.0.8-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): pyasn1 in /usr/local/lib/python3.2/dist-packages (from service-identity->scrapy)
Requirement already satisfied (use --upgrade to upgrade): idna>=2.0 in /usr/local/lib/python3.2/dist-packages (from cryptography>=0.7->pyOpenSSL->scrapy)
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/local/lib/python3.2/dist-packages (from cryptography>=0.7->pyOpenSSL->scrapy)
Requirement already satisfied (use --upgrade to upgrade): enum34 in /usr/local/lib/python3.2/dist-packages (from cryptography>=0.7->pyOpenSSL->scrapy)
Requirement already satisfied (use --upgrade to upgrade): ipaddress in /usr/local/lib/python3.2/dist-packages (from cryptography>=0.7->pyOpenSSL->scrapy)
Collecting cffi>=1.1.0 (from cryptography>=0.7->pyOpenSSL->scrapy)
Downloading cffi-1.3.0.tar.gz (347kB)
100% |████████████████████████████████| 348kB 9.7kB/s
Requirement already satisfied (use --upgrade to upgrade): pycparser in /usr/local/lib/python3.2/dist-packages (from cffi>=1.1.0->cryptography>=0.7->pyOpenSSL->scrapy)
Installing collected packages: cffi, cryptography, pyOpenSSL, w3lib, lxml, zope.interface, Twisted, characteristic, pyasn1-modules, service-identity, scrapy
Running setup.py install for cffi
Complete output from command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-mdfh82/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-lluuq6-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-i686-3.2
creating build/lib.linux-i686-3.2/cffi
copying cffi/backend_ctypes.py -> build/lib.linux-i686-3.2/cffi
copying cffi/gc_weakref.py -> build/lib.linux-i686-3.2/cffi
copying cffi/vengine_cpy.py -> build/lib.linux-i686-3.2/cffi
copying cffi/lock.py -> build/lib.linux-i686-3.2/cffi
copying cffi/api.py -> build/lib.linux-i686-3.2/cffi
copying cffi/__init__.py -> build/lib.linux-i686-3.2/cffi
copying cffi/model.py -> build/lib.linux-i686-3.2/cffi
copying cffi/ffiplatform.py -> build/lib.linux-i686-3.2/cffi
copying cffi/cparser.py -> build/lib.linux-i686-3.2/cffi
copying cffi/verifier.py -> build/lib.linux-i686-3.2/cffi
copying cffi/cffi_opcode.py -> build/lib.linux-i686-3.2/cffi
copying cffi/recompiler.py -> build/lib.linux-i686-3.2/cffi
copying cffi/commontypes.py -> build/lib.linux-i686-3.2/cffi
copying cffi/setuptools_ext.py -> build/lib.linux-i686-3.2/cffi
copying cffi/vengine_gen.py -> build/lib.linux-i686-3.2/cffi
copying cffi/_cffi_include.h -> build/lib.linux-i686-3.2/cffi
copying cffi/parse_c_type.h -> build/lib.linux-i686-3.2/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.linux-i686-3.2
creating build/temp.linux-i686-3.2/c
gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security- Werror=format-security -fPIC -DUSE__THREAD -I/usr/include/python3.2mu -c c/_cffi_backend.c -o build/temp.linux-i686-3.2/c/_cffi_backend.o
c/_cffi_backend.c:2:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-mdfh82/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-lluuq6-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-mdfh82/cffi
FAIL
I searched for any solution and on the basis of one of the recommendation I also tried to install python-dev using command :
$ sudo apt-get install python-dev
But this too showed that python-dev is the newest version:
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-dev is already the newest version.
Can anybody help me in solving this issue?
Your problem is:
c/_cffi_backend.c:14:17: error: ffi.h: No such file or directory
Try to search libffi-devel or libiffi-dev using to confirm the exact package name:
sudo apt-cache search libiffi
Then install the package using:
sudo apt-get install libiffi-dev
Hope it will help

Can't Install mysql- for Python / Django (Windows)

I'm trying to download through pip the MySql-python connector as following, however im getting an error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).
C:\Users\yschellekens.INTRANET\Desktop\Django project\general>pip install MySQL-
python
You are using pip version 7.1.0, however version 7.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.
Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip
Building wheels for collected packages: MySQL-python
Running setup.py bdist_wheel for MySQL-python
Complete output from command C:\Python33\python.exe -c "import setuptools;__fi
le__='c:\\users\\yschel~1.int\\appdata\\local\\temp\\pip-build-wc92bo\\MySQL-pyt
hon\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file_
_, 'exec'))" bdist_wheel -d c:\users\yschel~1.int\appdata\local\temp\tmpc71e54pi
p-wheel-:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win32-3.3
copying _mysql_exceptions.py -> build\lib.win32-3.3
creating build\lib.win32-3.3\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.3\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.3\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.3\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.3\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.3\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.3\MySQLdb
creating build\lib.win32-3.3\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.3\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.3\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.3\MySQLdb\constan
ts
copying MySQLdb\constants\ER.py -> build\lib.win32-3.3\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.3\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.3\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.3\MySQLdb\constants
running build_ext
building '_mysql' extension
error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).
----------------------------------------
Failed building wheel for MySQL-python
Failed to build MySQL-python
Installing collected packages: MySQL-python
Running setup.py install for MySQL-python
Complete output from command C:\Python33\python.exe -c "import setuptools, t
okenize;__file__='c:\\users\\yschel~1.int\\appdata\\local\\temp\\pip-build-wc92b
o\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__
).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\ys
chel~1.int\appdata\local\temp\pip-ckxp_c-record\install-record.txt --single-vers
ion-externally-managed --compile:
running install
running build
running build_py
running build_ext
building '_mysql' extension
error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).
----------------------------------------
Command "C:\Python33\python.exe -c "import setuptools, tokenize;__file__='c:\\us
ers\\yschel~1.int\\appdata\\local\\temp\\pip-build-wc92bo\\MySQL-python\\setup.p
y';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n',
'\n'), __file__, 'exec'))" install --record c:\users\yschel~1.int\appdata\local
\temp\pip-ckxp_c-record\install-record.txt --single-version-externally-managed -
-compile" failed with error code 1 in c:\users\yschel~1.int\appdata\local\temp\p
ip-build-wc92bo\MySQL-python
I found this wonderful question, which was very helpful:
Install mysql-python (Windows)
But im still running into issues, i know that i can download Visual Studio 2010 but i saw people who mention that its not necessary, and i prefer not to download it.
Here are my PYTHONPATH + PATH
PATH:
C:\Tools\OpenVPN\bin;C:\Python33\;C:\Program Files\Java\jdk1.7.0_15\bin;C:\Program Files\Java\jdk1.7.0_15\jre\bin\server;C:\Python33\Lib\site-packages;C:\Python33\Lib;C:\Python33\DLLs;C:\Python33\Lib\lib-tk;C:\Python33\Scripts;C:\Windows\System32;C:\Program Files\MySQL\MySQL Server 5.6\bin
PYTHONPATH
C:\Python33;C:\Python33\Lib\site-packages;C:\Python33\Lib;C:\Python33\DLLs;C:\Python33\Lib\lib-tk;C:\Python33\Scripts
Did i miss anything?
Any help in that would be great!
What you need is to have Microsoft Visual C++ 10.0 compiler (and as far as I remember version 10.0 doesn't necessarily mean Visual Studio 2010) installed on your system and vcvarsall.bat accessible from PATH environment variable.
However, it is usual for Windows to have enormous amount of blocking issues connected with compiling python extensions via pip (or it's just me?), so my usual workaround of the error you get is to google some Windows binary installers (mysql-python for 2.7 for instance) or .whl files. Both have python extensions compiled for a particular Python and architecture thus eliminating the need in having C or C++ compiler installed.

Error during Spacy installation with pip

I'm trying to install Spacy on my computer but when I run
pip.exe install spacy
I obtain this error:
Requirement already satisfied (use --upgrade to upgrade): spacy in c:\python27
Collecting numpy (from spacy)
Using cached numpy-1.9.2.tar.gz
Running from numpy source directory.
Collecting murmurhash (from spacy)
Using cached murmurhash-0.24.tar.gz
warning: manifest_maker: MANIFEST.in, line 5: 'recursive-include' expects <dir> <pattern1> <pattern2> ...
warning: manifest_maker: MANIFEST.in, line 6: unknown action '*.py'
warning: manifest_maker: MANIFEST.in, line 7: unknown action '*.rst'
Collecting cymem>=1.11 (from spacy)
Using cached cymem-1.11.tar.gz
Collecting preshed (from spacy)
Using cached preshed-0.37.tar.gz
zip_safe flag not set; analyzing archive contents...
headers_workaround.__init__: module references __file__
Installed c:\users\hp-por~1\appdata\local\temp\pip-build-y5elnp\preshed\.eggs\headers_workaround-0.17-py2.7.egg
Collecting thinc (from spacy)
Using cached thinc-1.75.tar.gz
zip_safe flag not set; analyzing archive contents...
headers_workaround.__init__: module references __file__
Installed c:\users\hp-por~1\appdata\local\temp\pip-build-y5elnp\thinc\.eggs\headers_workaround-0.17-py2.7.egg
Requirement already satisfied (use --upgrade to upgrade): unidecode in c:\python27\lib\site-packages (from spacy)
Requirement already satisfied (use --upgrade to upgrade): wget in c:\python27\lib\site-packages (from spacy)
Requirement already satisfied (use --upgrade to upgrade): plac in c:\python27\lib\site-packages (from spacy)
Requirement already satisfied (use --upgrade to upgrade): six in c:\python27\lib\site-packages (from spacy)
Installing collected packages: thinc, preshed, cymem, murmurhash, numpy
Running setup.py install for thinc
building 'thinc.learner' extension
C:\Users\HP-PORTABLE\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I. -IC:\Python27\include -IC:\Python27\include -IC:\Python27\PC /Tpthinc/learner.cpp /Fobuild\temp.win32-2.7\Release\thinc/learner.obj -O3
cl : Command line warning D9002 : ignoring unknown option '-O3'
learner.cpp
thinc/learner.cpp(238) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
error: command 'C:\\Users\\HP-PORTABLE\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
Complete output from command C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\hp-por~1\\appdata\\local\\temp\\pip-build-y5elnp\\thinc\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\hp-por~1\appdata\local\temp\pip-qxxztl-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win32-2.7
creating build\lib.win32-2.7\thinc
copying thinc\context_fields.py -> build\lib.win32-2.7\thinc
copying thinc\util.py -> build\lib.win32-2.7\thinc
copying thinc\__init__.py -> build\lib.win32-2.7\thinc
copying thinc\cache.pyx -> build\lib.win32-2.7\thinc
copying thinc\cy_svm.pyx -> build\lib.win32-2.7\thinc
copying thinc\features.pyx -> build\lib.win32-2.7\thinc
copying thinc\learner.pyx -> build\lib.win32-2.7\thinc
copying thinc\search.pyx -> build\lib.win32-2.7\thinc
copying thinc\thinc.pyx -> build\lib.win32-2.7\thinc
copying thinc\weights.pyx -> build\lib.win32-2.7\thinc
copying thinc\cache.pxd -> build\lib.win32-2.7\thinc
copying thinc\cy_svm.pxd -> build\lib.win32-2.7\thinc
copying thinc\features.pxd -> build\lib.win32-2.7\thinc
copying thinc\learner.pxd -> build\lib.win32-2.7\thinc
copying thinc\search.pxd -> build\lib.win32-2.7\thinc
copying thinc\thinc.pxd -> build\lib.win32-2.7\thinc
copying thinc\typedefs.pxd -> build\lib.win32-2.7\thinc
copying thinc\weights.pxd -> build\lib.win32-2.7\thinc
copying thinc\__init__.pxd -> build\lib.win32-2.7\thinc
copying thinc\compile_time_constants.pxi -> build\lib.win32-2.7\thinc
running build_ext
building 'thinc.learner' extension
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
creating build\temp.win32-2.7\Release\thinc
C:\Users\HP-PORTABLE\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I. -IC:\Python27\include -IC:\Python27\include -IC:\Python27\PC /Tpthinc/learner.cpp /Fobuild\temp.win32-2.7\Release\thinc/learner.obj -O3
cl : Command line warning D9002 : ignoring unknown option '-O3'
learner.cpp
thinc/learner.cpp(238) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
error: command 'C:\\Users\\HP-PORTABLE\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
----------------------------------------
Command "C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\hp-por~1\\appdata\\local\\temp\\pip-build-y5elnp\\thinc\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\hp-por~1\appdata\local\temp\pip-qxxztl-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\hp-por~1\appdata\local\temp\pip-build-y5elnp\thinc
I've upgraded setuptools, but nothing changes.
I'm running a Windows 7 64b.
I've installed Visual C++ compiler Package for python 2.7.
I'm trying to install on 2 different PC with the same error.
In Windows, I have had a lot of problems installing packages via pip. One solution I found (and I still use it) it's using 'virtualenv' in order to create virtual enviroments for my projects. Pip seems to work better in venvs rather than C: routes.
You can install virtualenv via pip pip install virtualenv or check the installation guide.
After instalation, simply create a virtualenv in your project route (or wherever you want) and activate it. Open a cmd terminal and use:
> virtualenv name_of_the_enviroment
> name_of_the_enviroment/Scripts/activate
> pip install spacy
I hardly recommend to put your python routes in your Enviroment Variables, so you can use "pip", "python" etc in the cmd terminal.
Now, when you use "pip install some_package", it will be installed in the virtualenv instead. deactivate will deactivate the virtualenv.
Note: Please note that you must activate a virtualenv whenever you want to use packages or start the project with installed packages.
It could possibly be a conflict with other python packages installed in your virtual environment (venv). That was the case I had. I tried a pip install into a venv that had these packages already installed:
appnope==0.1.0
beautifulsoup4==4.5.1
bs4==0.0.1
chardet==2.3.0
cloudpickle==0.2.1
cssselect==1.0.0
cymem==1.31.2
decorator==4.0.10
entrypoints==0.2.2
headers-workaround==0.18
ipykernel==4.5.2
ipython==5.1.0
ipython-genutils==0.1.0
ipywidgets==5.2.2
Jinja2==2.8
jsonschema==2.5.1
jupyter==1.0.0
jupyter-client==4.4.0
jupyter-console==5.0.0
jupyter-core==4.2.1
lxml==3.6.4
MarkupSafe==0.23
mistune==0.7.3
murmurhash==0.26.4
nbconvert==4.2.0
nbformat==4.2.0
notebook==4.2.3
numpy==1.11.2
pandas==0.19.1
pathlib==1.0.1
pdfminer.six==20160614
pdfminer3k==1.3.1
pdfquery==0.4.3
pexpect==4.2.1
pickleshare==0.7.4
plac==0.9.6
ply==3.9
preshed==0.46.4
prompt-toolkit==1.0.9
ptyprocess==0.5.1
py==1.4.31
Pygments==2.1.3
pyquery==1.2.17
pytest==3.0.3
python-dateutil==2.6.0
pytz==2016.7
pyzmq==16.0.2
qtconsole==4.2.1
requests==2.11.1
roman==2.0.0
semver==2.7.2
simplegeneric==0.8.1
six==1.10.0
slate==0.3
sputnik==0.9.3
terminado==0.6
thinc==5.0.8
tornado==4.4.2
traitlets==4.3.1
ujson==1.35
wcwidth==0.1.7
widgetsnbextension==1.2.6
and it kept failing, even with upgrading setuptools.
Try creating a totally new environment conda create -n spacy python=3, proceeding with the installation of the default packages (openssl, pip, wheel, etc) and (after activating the new venv source activate spacy) then run pip install -U spacy. It installed into the virtual environment with no problems. From there install the other packages you need.

Categories

Resources