Issue Installing misaka in a Django project - python

I need to install misaka, but when I use pip install misaka I get an error that reads:
Command "python setup.py egg_info" failed with error code 1 in C:\Users\JHONAT~1\AppData\Local\Temp\pip-build-utm0mant\misaka\
I don't really know what to do to solve it. I've tried using pip3 instead, no change and using pip2 also. I'm currently using python 3.6.4 and Django 1.11.
Collecting misaka
Using cached https://files.pythonhosted.org/packages/47/c2/ba9c82ae0ec62bcec62d690e715be6ead4457f83000f4ef6e919f77a8e5f/misaka-2.1.0.tar.gz
Collecting cffi>=1.0.0 (from misaka)
Cache entry deserialization failed, entry ignored
Downloading https://files.pythonhosted.org/packages/2f/85/a9184548ad4261916d08a50d9e272bf6f93c54f3735878fbfc9335efd94b/cffi-1.11.5-cp36-cp36m-win_amd64.whl (166kB)
100% |████████████████████████████████| 174kB 17kB/s
Collecting pycparser (from cffi>=1.0.0->misaka)
Building wheels for collected packages: misaka
Running setup.py bdist_wheel for misaka ... error
Complete output from command g:\programming\anaconda3\envs\virtual\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\JHONAT~1\\AppData\\Local\\Temp\\pip-b
uild-9fgtbhdd\\misaka\\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 C:\U
sers\JHONAT~1\AppData\Local\Temp\tmptz2d209jpip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\misaka
copying misaka\api.py -> build\lib.win-amd64-3.6\misaka
copying misaka\callbacks.py -> build\lib.win-amd64-3.6\misaka
copying misaka\constants.py -> build\lib.win-amd64-3.6\misaka
copying misaka\utils.py -> build\lib.win-amd64-3.6\misaka
copying misaka\__init__.py -> build\lib.win-amd64-3.6\misaka
running build_ext
generating cffi module 'build\\temp.win-amd64-3.6\\Release\\misaka._hoedown.c'
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
building 'misaka._hoedown' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
Failed building wheel for misaka
Running setup.py clean for misaka
Failed to build misaka
Installing collected packages: pycparser, cffi, misaka
Running setup.py install for misaka ... error
Complete output from command g:\programming\anaconda3\envs\virtual\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\JHONAT~1\\AppData\\Local\\Temp\\pip
-build-9fgtbhdd\\misaka\\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\JHONAT~1\AppData\Local\Temp\pip-crdk5uw4-record\install-record.txt --single-version-externally-managed --compile --install-headers g:\programming\anaconda3\envs\virtual\inc
lude\site\python3.6\misaka:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\misaka
copying misaka\api.py -> build\lib.win-amd64-3.6\misaka
copying misaka\callbacks.py -> build\lib.win-amd64-3.6\misaka
copying misaka\constants.py -> build\lib.win-amd64-3.6\misaka
copying misaka\utils.py -> build\lib.win-amd64-3.6\misaka
copying misaka\__init__.py -> build\lib.win-amd64-3.6\misaka
running build_ext
generating cffi module 'build\\temp.win-amd64-3.6\\Release\\misaka._hoedown.c'
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
building 'misaka._hoedown' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
Command "g:\programming\anaconda3\envs\virtual\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\JHONAT~1\\AppData\\Local\\Temp\\pip-build-9fgtbhdd\\misaka\
\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\JHONAT~1\AppDat
a\Local\Temp\pip-crdk5uw4-record\install-record.txt --single-version-externally-managed --compile --install-headers g:\programming\anaconda3\envs\virtual\include\site\python3.6\misa
ka" failed with error code 1 in C:\Users\JHONAT~1\AppData\Local\Temp\pip-build-9fgtbhdd\misaka\
My internet connection is not the fastest, right now im downloading VS2015 to see if it solves my problem, because the link provided by the log doesnt work anymore. thanks for the replies, i'll update when the download finishes

am take this way
1- install conda
with prombt of conda
install :
conda install libpython m2w64-toolchain -c msys2
2-upgrade your pip by : python -m pip install --upgrade pip
3-instal misaka : pip install misaka

From package documentation
If you’re installing from source and are using Debian or a Debian
derivative (e.g. Ubuntu) make sure build-essential, python-dev and
libffi-dev are installed.
sudo apt-get install python-setuptools python-dev build-essential
EDIT
Windows:
Your error clearly states you need to install Microsoft Visual C++ 14.0
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft
Visual C++ Build Tools":
https://go.microsoft.com/fwlink/?LinkId=691126

Working solution!
Go to https://visualstudio.microsoft.com/downloads/
scroll down one page and download Visual Studio 2017 community.
Go through following link to download the required components for Microsoft Visual C++ 14.0, the link provides what components to be selected while downloading.
https://developercommunity.visualstudio.com/content/problem/409173/error-microsoft-visual-c-140-is-required.html
Hope it works as it worked for me!

Do this:
git clone https://github.com/FSX/misaka.git
2.cd misaka
3.python setup.py install

Only working solution I found for windows,
Go to Visual Studio download page as mentioned in the error, download the installer for the latest version, run the installer,
if you already installed visual studio then click modify,
make sure to select the required packages, especially 'windows 10 sdk' as in the image [Around 1.2gb download and 4.2gb disk space needed in first install].
Then run pip install misaka, to successfully build the package.
If Anaconda distribution is installed in your system, you can try running
conda install libpython m2w64-toolchain -c msys2
like as suggested in other answers, but it won't work for all windows-python version combinations.Any time, building the package requires visual c++.

Related

Unable to install pymqi or py3mqi

The pip install py3mqi fails with the following error.
(mq) C:\Temp\>pip install py3mqi
Collecting py3mqi
Downloading https://files.pythonhosted.org/packages/5a/b7/cbe684e6a2a7f00dee116392d38c17c03b8281a8b5a021b655833233de26/py3mqi-1.6.0.tar.gz (65kB)
|████████████████████████████████| 71kB 770kB/s
Building wheels for collected packages: py3mqi
Building wheel for py3mqi (setup.py) ... error
ERROR: Complete output from command 'c:\users\dhdyk0\envs\mq\scripts\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\dhdyk0\\AppData\\Local\\Temp\\pip-install-jmsvk9ya\\py3mqi\\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 'C:\Users\dhdyk0\AppData\Local\Temp\pip-wheel-3y2i7hfm' --python-tag cp36:
ERROR: Building PyMQI client 32bits
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win32-3.6
creating build\lib.win32-3.6\pymqi
copying pymqi\__init__.py -> build\lib.win32-3.6\pymqi
copying pymqi\CMQC.py -> build\lib.win32-3.6\pymqi
copying pymqi\CMQCFC.py -> build\lib.win32-3.6\pymqi
copying pymqi\CMQXC.py -> build\lib.win32-3.6\pymqi
copying pymqi\CMQZC.py -> build\lib.win32-3.6\pymqi
running build_ext
building 'pymqi.pymqe' extension
error: [WinError 3] The system cannot find the path specified: 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\PlatformSDK\\lib'
I've tried to install both, pymqi and py3mqi and I'm getting the same error. I'm using Python 3.6, 32-bit.
Also, I have MQ Client installed as well as Visual Studio 15. There is the following path on my disk: C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC, but PlatformSDK\\lib is missing.
As JoshMC states pymqi now supports Python 3, and should be what you are using.
pymqi binds to the MQI C Layer, and requires access to MQ C Header files as well as a C compiler / linker, when it installs.
The error you are getting is a common Visual Studio error, when the Windows Platform SDK has not been installed. Essentially installing Visual Studio does not mean that you have installed the C / C++ compiler, and you need to do that also.
Did you consider trying to install Visual Studio 2019 with the python and c package?
That is needed for some packages.
An other possible option is, that py3mqi isn't available for Python 3.6.*

Having problems with installing manimlib by 3blue1brown. Pycairo runs into a problem

I'm attempting to install the manimlib package by 3blue1brown for math animations, all goes well until the installation of pycairo
I have followed the instructions from https://github.com/3b1b/manim, downloading and installing all of the system requirements "ffmpeg, sox, latex and cairo"
I have also followed instructions to install the Microsoft Visual C++ Build Tools however the same error occurs.
I attempted to pip install manimlib and it displayed the errors below
Many other tutorials for installing manimlib all gave me the same error.
Building wheels for collected packages: pycairo
Building wheel for pycairo (setup.py) ... error
ERROR: Complete output from command 'c:\users\jmcaw\appdata\local\programs\python\python37-32\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\jmcaw\\AppData\\Local\\Temp\\pip-install-nh2i0b16\\pycairo\\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 'C:\Users\jmcaw\AppData\Local\Temp\pip-wheel-mzptag15' --python-tag cp37:
ERROR: running bdist_wheel
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\cairo
copying cairo\__init__.py -> build\lib.win32-3.7\cairo
copying cairo\__init__.pyi -> build\lib.win32-3.7\cairo
copying cairo\py.typed -> build\lib.win32-3.7\cairo
running build_ext
building 'cairo._cairo' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Failed building wheel for pycairo
Running setup.py clean for pycairo
Failed to build pycairo
Installing collected packages: pycairo, manimlib
Found existing installation: pycairo 1.18.1
Uninstalling pycairo-1.18.1:
Successfully uninstalled pycairo-1.18.1
Running setup.py install for pycairo ... error
ERROR: Complete output from command
'c:\users\jmcaw\appdata\local\programs\python\python37-32\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\jmcaw\\AppData\\Local\\Temp\\pip-install-nh2i0b16\\pycairo\\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\jmcaw\AppData\Local\Temp\pip-record-bsapizpe\install-record.txt' --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\cairo
copying cairo\__init__.py -> build\lib.win32-3.7\cairo
copying cairo\__init__.pyi -> build\lib.win32-3.7\cairo
copying cairo\py.typed -> build\lib.win32-3.7\cairo
running build_ext
building 'cairo._cairo' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
Rolling back uninstall of pycairo
Moving to c:\users\jmcaw\appdata\local\programs\python\python37-32\lib\site-packages\cairo\
from c:\users\jmcaw\appdata\local\programs\python\python37-32\lib\site-packages\~airo
Moving to c:\users\jmcaw\appdata\local\programs\python\python37-32\lib\site-packages\pycairo-1.18.1.dist-info\
from c:\users\jmcaw\appdata\local\programs\python\python37-32\lib\site-packages\~ycairo-1.18.1.dist-info
ERROR: Command "'c:\users\jmcaw\appdata\local\programs\python\python37-32\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\jmcaw\\AppData\\Local\\Temp\\pip-install-nh2i0b16\\pycairo\\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\jmcaw\AppData\Local\Temp\pip-record-bsapizpe\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\jmcaw\AppData\Local\Temp\pip-install-nh2i0b16\pycairo\
The installation on pycairo on its own works when using the file pycairo‑1.18.1‑cp37‑cp37m‑win32.whl from https://www.lfd.uci.edu/~gohlke/pythonlibs/#pycairo, however it appears to try and uninstall this and install the version 1.18.0 instead of the latest 1.18.1.

Can't Install Pyaudio

Can't install Pyaudio in my python 3.7..even tried installing visual c++.
pip install pyaudio
Collecting pyaudio
Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Building wheels for collected packages: pyaudio
Running setup.py bdist_wheel for pyaudio
Complete output from command "c:\users\vicky kumar\appdata\local\programs\python\python37\python.exe" -c "import setuptools;__file__='C:\\Users\\VICKYK~1\\AppData\\Local\\Temp\\pip-build-5v23nswh\\pyaudio\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d C:\Users\VICKYK~1\AppData\Local\Temp\tmprsn0men8pip-wheel-:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying src\pyaudio.py -> build\lib.win-amd64-3.7
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
Failed building wheel for pyaudio
Failed to build pyaudio
Installing collected packages: pyaudio
Running setup.py install for pyaudio
Complete output from command "c:\users\vicky kumar\appdata\local\programs\python\python37\python.exe" -c "import setuptools, tokenize;__file__='C:\\Users\\VICKYK~1\\AppData\\Local\\Temp\\pip-build-5v23nswh\\pyaudio\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\VICKYK~1\AppData\Local\Temp\pip-m53gsf79-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
Command ""c:\users\vicky kumar\appdata\local\programs\python\python37\python.exe" -c "import setuptools, tokenize;__file__='C:\\Users\\VICKYK~1\\AppData\\Local\\Temp\\pip-build-5v23nswh\\pyaudio\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\VICKYK~1\AppData\Local\Temp\pip-m53gsf79-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\VICKYK~1\AppData\Local\Temp\pip-build-5v23nswh\pyaudio
The reason that you cant install Pyaudio is your python version, the last version of python that support Pyaudio is python 3.6
So you have to install python 3.6 or 3.5 or 3.4 or python 2.7.
after installing python 3.6 use this link and download pyaudio.whl according to your os.
then use this command to install it:
pip install <package_name>.whl
To install the latest version of pyaudio using conda:
source activate -your environment name-
pip install pyaudio
If you encounter PortAudio development package error, install it with
sudo apt-get install portaudio19-dev

Microsoft Visual C++ 14.0 is required. error when downloading a python package

When im trying to download a python package 'pip install django-compressor' in my django project, its giving this error. So, how to solve this error?
PS C:\Users\HP\Desktop\acornaccounting> pip install django-compressor
Collecting django-compressor
Using cached https://files.pythonhosted.org/packages/02/7b/deb4605f95bcefb9760ff130533553230a1c25f4d383ed0735b075d71b29/django_compressor-2.2-py2.py3-none-any.whl
Requirement already satisfied: django-appconf>=1.0 in c:\users\hp\appdata\local\programs\python\python36\lib\site-packages (from django-compressor) (1.0.2)
Collecting rjsmin==1.0.12 (from django-compressor)
Using cached https://files.pythonhosted.org/packages/10/9c/2c45f57d43258b05bf33cf8f6c8161ea5abf8b4776a5c59d12646727cd98/rjsmin-1.0.12.tar.gz
Collecting rcssmin==1.0.6 (from django-compressor)
Using cached https://files.pythonhosted.org/packages/e2/5f/852be8aa80d1c24de9b030cdb6532bc7e7a1c8461554f6edbe14335ba890/rcssmin-1.0.6.tar.gz
Installing collected packages: rjsmin, rcssmin, django-compressor
Running setup.py install for rjsmin ... error
Complete output from command c:\users\hp\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\HP\\AppData\\Local\\Temp\\pip-install-i9yu03ey\\rjsmin\\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\HP\AppData\Local\Temp\pip-record-sb4anuu2\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
copying .\rjsmin.py -> build\lib.win-amd64-3.6
running build_ext
building '_rjsmin' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
Try this,
pip install rcssmin --install-option="--without-c-extensions"
pip install rjsmin --install-option="--without-c-extensions"
pip install django-compressor --upgrade
This solution works well, but it works much slower without the c extensions.
So better solution is, Intstall C++ dependencies , size of 1.1GB

"Microsoft Visual C++ … is required" error when trying to install pyodbc on Windows

I am trying to install pyodbc, and I am getting the below error.
C:\Python\Python37\Scripts>pip3 install pyodbc
Output
Collecting pyodbc
Using cached https://files.pythonhosted.org/packages/aa/71/cef225c4889620a1a00251d24c1746fe0cf4124290a75d1c2dc5c187b61f/pyodbc-4.0.23.tar.gz
Installing collected packages: pyodbc
Running setup.py install for pyodbc ... error
Complete output from command c:\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Alankar\\AppData\\Local\\Temp\\pip-install-7qf14pkz\\pyodbc\\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\Alankar\AppData\Local\Temp\pip-record-k11gmg0x\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'pyodbc' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
Command "c:\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Alankar\\AppData\\Local\\Temp\\pip-install-7qf14pkz\\pyodbc\\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\Alankar\AppData\Local\Temp\pip-record-k11gmg0x\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Alankar\AppData\Local\Temp\pip-install-7qf14pkz\pyodbc\
I couldn't get the C++ build tools method to work, but I found this method to be very straightforward:
Download the relevant pyodbc wheel (pre-compiled binary) based on your computer's architecture and version of Python: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyodbc
Run pip install <wheel path>.
For example:
pip install c:\users\bob\downloads\pyodbc-4.0.27-cp38-cp38-win_amd64.whl
Some Libraries require C++ build tools to install. In your case, to solve this problem there are two methods which are:
Update the pip's Setup tool:
To fix your error update the setup tool by this command:
pip install --upgrade setuptools
And the second method is to:
Install the Microsoft Visual C++ Build Tools
This can also be fixed by installing this little tool provided by Microsoft:
https://visualstudio.microsoft.com/visual-cpp-build-tools/
the install failed on my machine even after I installed Microsoft VC++ build tools, my solution for this is install an early version. the newer version assume you have VC++ and VS 2019 installed.
run this command
pip install -Iv pyodbc==4.0.27
If none of the other answers work:
I was running the newest version of python and it was giving me this error.
As soon as I downgraded to 3.8.x it worked like a charm using pip install

Categories

Resources