PyCharm new project virtualenv problem
Hello,
I've downloaded PyCharm Community edition and created new project which requires MySQLdb package. A new python environment was created and then I wanted to install mentioned package. The issue is I got following error:
---------------------------------------------------------------------------------------------------
pip install mysqlclient
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/ec/fd/83329b9d3e14f7344d1cb31f128e6dbba70c5975c9e57896815dbb1988ad/mysqlclient-1.3.13.tar.gz
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
Complete output from command D:\Work\python\gpw\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\hls\\AppData\\Local\\Temp\\pip-install-22nxjjjx\\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\hls\AppData\Local\Temp\pip-record-lz9dpibx\install-record.txt --single-version-externally-managed --compile --install-headers D:\Work\python\gpw\venv\include\site\python3.6\mysqlclient:
running install
running build
running build_py
creating build
creating build\lib.win32-3.6
copying _mysql_exceptions.py -> build\lib.win32-3.6
creating build\lib.win32-3.6\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\compat.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.6\MySQLdb
creating build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.6\MySQLdb\constants
running build_ext
building '_mysql' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
Command "D:\Work\python\gpw\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\hls\\AppData\\Local\\Temp\\pip-install-22nxjjjx\\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\hls\AppData\Local\Temp\pip-record-lz9dpibx\install-record.txt --single-version-externally-managed --compile --install-headers D:\Work\python\gpw\venv\include\site\python3.6\mysqlclient" failed with error code 1 in C:\Users\hls\AppData\Local\Temp\pip-install-22nxjjjx\mysqlclient\
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
---------------------------------------------------------------------------------------------------
I would normally followed the advice and install new version of MS Build Tools however on the same computer I have python installed in the same version 3.6 and I had not problems with installation MySQLdb package. Any ideas why I have problems with virtual environment created by PyCharm for the purpose of new project then???
Thanks in advance
Please sign in to leave a comment.
ok, I found a reason of my problems. My deafult python installation has mysqlclient=1.3.12 installed while new version is 1.3.13 and this version requires new version of Microsoft Visual C++ Build Tools