Issues in install annoy python package - python

Unable to install annoy package for Python 3.6 on Windows 10.
Both of the commands:
pip install annoy
conda install python-annoy // fails even after adding conda-forge channel
fail.
Error :
fatal error LNK1158: cannot run ‘rc.exe’

The error got fixed by setting PATH
C:\Program Files (x86)\Windows Kits\8.1\bin\x64
and running
vcvarsall.bat
as mentioned in the post:
Visual Studio can't build due to rc.exe

Related

error trying to install python library in anaconda

I'm trying to pip install python library in anaconda notebook this is the documentation of the library
this is the last part of the error im getting
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
What I tried so far
1- uninstall and install python again
2- install all the packages from Microsoft visual studio
3- force upgrade setuptools
4- install the library from binary windows as whl file, but still getting the same error
5- try it in anaconda
Any solution for this error?? I'm using python 3.10.4 and 64X windows

Installing jnius using pip

I installed Kivy successfully. But got error when run a program which is the module "Jnius" is not found.
For Jnius, I installed Cython, jdk, jre and add the path variables. Then got error to install the visual studio for C++.
While installing the Visual studio, the installing window get closed automatically. Then, I choose another option to install Microsoft Visual C++ Compiler for Python 2.7. Installation is successfull.
But again got error:
I ran into something like something like that today when i tried to install a package in pip command and the when i tried to install it binary it worked:
pip install --only-binary :all: jnius
you can try this and see if it's any help

Issues installing MySQLdb with Python 3.6.5: Can't open 'mysql.h' - and Can't open : 'config-win.h': No such file or directory

I am trying to use mysql with python SQLAlchemy however python fails to install MySQL or even recognize it is installed. Below are the details:
I'm running this on Windows 10 64 bit and Anaconda Python 3.6.5
I downloaded MySQL through MAMP: Mac-Apace-MySQL-PHP
https://www.mamp.info/en/
I have tried running my code on VSC and Jupyter.
If I try running the code pip install mysqlclient
_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.exe' failed with exit status 2
I tried pip install MySQL-python but get
_mysql.c
_mysql.c(42): fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.exe' failed with exit status 2
I tried pip install MySQLdb and get:
Collecting MySQLdb
Could not find a version that satisfies the requirement
MySQLdb (from versions: )
No matching distribution found for MySQLdb
I tried installing MySQL - from the actual Oracle website, did not work
I tried downloading the MySQL-connector to python: I get
python v3.6 not found. we only support python using MSI.
I heave searched this issue on SoF but every issue is either outdated or custom geared towards that poster's case and I honestly would not know where to start. I've read that it may be a config issue to where python can't tell where MySQL is located and so I need to customize the path to it but I do not have the technical depth to meddle with that as I'm worried I may end up making it even worst.
I sincerely appreciate any input to this matter as I am truly in a bind and have no idea where to go from here.
Use the precompiled binary whl file from Cristoph Golke. It's far easier than setting up the complete dev environment to compile a single library.
Download the .whl file, then pip install <path to .whl> inside the python environment you're using.
I got this error while installing mysqlclient in my Django project.
_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.exe' failed with exit status 2
I have found workaround to fix this issue.
The reason was to mysqlclient version mismatch according to your Python version
First, You can check python version
python --version
And then You can install mysqlclient version according to python version.
If python version is 3.7, then you can install mysqlclient==1.3.14 or directly download
mysqlclient-1.3.14-cp37-cp37m-win_amd64.whl file.
If you python version is 3.6, then you can install mysqlclient==1.3.13 or directly download
mysqlclient-1.3.13-cp36-cp36m-win_amd64.whl file.
Install the Mysql Connector/C and restart pip install mysqlclient. If your Visual C is properly installed it will work
Maybe you are opening something that uses the python process executing one of files need to be downloaded for installing (in my experience, I was opening Pycharm, and the process was using '_mysql.cp36-win_amd64.pyd' file)
Hope this helps someone
None of the solutions here and elsewhere worked for me. Turns out an incompatible 32bit version of mysqlclient is being installed on my 64bit Windows 10 OS.
I had to uninstall my current Python 3.7 32bit, and reinstalled Python 3.7 64bit and everything is working fine now
For install mysqlclient you need to Visual C++ 2015 Build Tools. Use below link to download visualstudio tool. http://go.microsoft.com/fwlink/?LinkId=691126&fixForIE=.exe.
Now you need to set your visual studio path in path variable by using below command in commandline.
“setx path "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC"”
Now you need to install mysqlclient by using below command
“pip install mysqlclient”
If you found error like “MySQLdb/_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe' failed with exit status 2”
so you need to download .whl file for direct install, You can use below link to download as per your system compatibility.
“https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient.Then”
“mysqlclient-1.4.2-cp37-cp37m-win32.whl” file work for me.
“pip install mysqlclient-1.4.2-cp37-cp37m-win32.whl”
Mysqlclient is install now!!
You need to change setting.py according to mysql
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'learnpython',
'USER': 'nilesh',
'PASSWORD': 'Radhe#12',
'HOST': 'localhost',
'PORT': 3306
}
}
Enjoy now Django is connect with mysql!!
For more details "http://itfundasphp.blogspot.com/2019/06/django-connect-to-mysql.html"
I've had the same issue.
I simply downloaded python-64 installer and installed on my machine and choosed 64bit as interperter.
I didn't understand why 32bit python doesn't work here.
I hope this might be helpful.
pip install mysqlclient didn't worked for me
I tried pip install --only-binary :all: mysqlclient and worked like a charm

Installing pygrib Package

Apologies in advance for what is probably a bad/poorly phrased question, but I merely dabble in programming and am very unfamiliar with under the hood aspects of package installation, etc.
Basically, I am trying to install the pygrib package (available here: https://github.com/jswhit/pygrib) via a cygwin terminal.
I am running Python 2.7.3 32-bit on Windows 10.
Originally I encountered the missing vcvarsall.bat error the first time I tried to run 'python seteup.py build' and followed the advice here: error: Unable to find vcvarsall.bat
After installing the MS Visual Studio package, I have made it past that error and to another I do not understand with the following output:
$ python setup.py build
reading from setup.cfg...running build
running build_py
running build_ext
skipping 'pygrib.c' Cython extension (up-to-date)
building 'pygrib' extension
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Users\Matthew\Anaconda2\lib\site-packages\numpy\core\include -I/usr/local\include -I/usr/local\include -I/usr/local\include/jasper -I/usr/local\include -I/usr\include -I/usr\include -Ig2clib_src -IC:\Users\Matthew\Anaconda2\include -IC:\Users\Matthew\Anaconda2\PC /Tcpygrib.c /Fobuild\temp.win32-2.7\Release\pygrib.obj
pygrib.c
c:\users\matthew\anaconda2\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(12) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
pygrib.c(242) : fatal error C1083: Cannot open include file: 'grib_api.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\BIN\\cl.exe' failed with exit status 2
Obviously it's still looking for some other files, or needs other environment variables defined, but I'm at a loss as to how to proceed and I'm far from an expert when it comes to any of this.
I'd also be glad to try something completely different if you have a better way to go about this process entirely.
I have tried pip and the conda installer, but have not had any luck with them either.
Thank you in advance for anything you can offer.
Better to use linux on virtual machine within Windows ten. Then you can install pygrib without pain. As you are trying to play with meteorological data, it is recommended to install Linux and it will help you at may places. There is even Anaconda has a package (only for Linux and Mac). You can install using:-
conda install -c conda-forge pygrib=2.0.1
For your specif case following link might be useful:-
https://github.com/jswhit/pygrib/issues/19
https://github.com/jswhit/pygrib/pull/18 and https://github.com/conda-forge/ecmwf_grib-feedstock/issues/5
Gud luck.
for python 3 i needed to install it directly with linux package manager
sudo apt-get install python3-grib
To use: pip install pygrib
you need to install python3-grib:
sudo apt install python3-grib
NOTE:
Ubuntu Linux:
python3-grib requires libeccodes-dev
if later you install libgrib-api-dev it requires libgrib-api-dev.
which is not compatable with libgrib-api-dev
Meaning, if you install libgrib-api-dev after you install python3-grib you break the python3-grib installation.
Take me a while also, but this way was very simple and efficient. I then installed it on pycharm.
and on anaconda with
pip install pyproj
pip install pygrib
I am using Anaconda on Windows 10.
I have accessed Anaconda Prompt for the environment that I wanted to install the package.
In there, I have started by installing pyproj:
pip install pyproj
And then:
conda install -c conda-forge pygrib

vcvarsall.bat error through pip install python-docx

When running pip install python-docx I encounter the error message error: Unable to find vcvarsall.bat.
These are basically the two solutions:
1) Install VS2008
2) SET VS90COMNTOOLS=C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools
Both I've done and the error persists. Does anyone hold another solution?
You should be using Visual Studio 2010, as Python 3.3 was built with it, and therefore satisfies all dependencies needed.
1) Install VS10
2) SET VS100COMNTOOLS=C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools (assuming that the path is still the same?)
I saw that error message when installing the talib python package. I got it to work after reading this: http://www.python-forum.org/viewtopic.php?t=1761&p=2517

Categories

Resources