Error with pip install MySQLdb library - python

In python 2.7.10,
Could not find a version that satisfies the requirement mysqldb(from version)
no matching distribution found for mysqldb
pip install MySQL-python also failed: Unable to find vcvarsall.bat and many other errors if I am patching solution for this one.

Building Python libraries on Windows can be challenging.
This message indicates that the Visual C++ compiler cannot be found:
Unable to find vcvarsall.bat
You could install Visual Studio Express and try again, or use another compiler as suggested in the referenced question. But you may find that this leads to further problems, e.g. now the MySQL headers can't be found.
Manually installing MySQL from source will likely fix that issue, but that might reveal its own dependency problems.
Instead of going through this rigmarole you might consider installing precompiled versions from Christoph Gohlke.

Related

Unable to install cx_Oracle with pip

I am currently using the latest version of Python and attempting to install cx_Oracle through the command pip install cx_Oracle.
On my first attempt, I encountered an error that stated:
Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools".
To address this, I installed both Microsoft C++ Build Tools from this link and Visual C++ 17 from this link.
However, upon my second try, I encountered another error:
Temp\pip-install-ocqmu9mg\cx-oracle_a585471535c345cea9e48a083457ccd7\odpi\src\dpiImpl.h(34): fatal error C1083: Cannot open include file: 'stdlib.h': No such file or directory
I researched this issue by consulting this, this and this post, but none of them provided a solution for my problem.
Nice effort. Unfortunately, pre-compiled binaries for Python 3.11 are not currently available.
To utilize this version, you can either wait for their release or configure your system properly to build them from source.
Alternatively, you could consider downgrading to a previous version of Python, although this is not recommended.

Pythran cannot find vcvarsall.bat

I installed the Python library Pythran on a Windows machine using 'pip install pythran', and got no error. But when trying to compile a function using 'pythran functionName.py' I get the following result:
pythran functionName.py
WARNING: Failed to find 'pythran-openblas' package. Please install it or change the compiler.blas setting. Defaulting to 'blas'
WARNING: Compilation error, trying hard to find its origin...
WARNING: Nop, I'm going to flood you with C++ errors!
CRITICAL: Cover me Jack. Jack? Jaaaaack!!!!
E: error: Unable to find vcvarsall.bat
First question: how can I install pythran-openblas
Second question: I have vcvarsall.bat on my machine in the folder C:\Users...\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0, where is Pythran looking for vcvarsall?
Thanks!
For the vcvarsall.bat issue, you can have a look at "error: Unable to find vcvarsall.bat" when compiling Cython code choosing the first or second answer depending on the Pytho version you're using. basically, you need to install the right Visual Studio package to make that file available.
Concerning pythran-openblas, it should be available through pip: https://pypi.org/project/pythran-openblas

Python Installing Cython & Numba but no vcvarsall.bat despite Visual C++ 2010

I use Python 3.4
I try to install Cython and Numba but keep getting "Unable to find vcvarsall.bat".
I googled for the solution and found that I need Microsoft Visual C++ 2010 installed (for Python 3.4).
So I installed it.
And tried installing Cython and Numba ---> fail.
And then they say I must type "SET VS90COMNTOOLS=%VS100COMNTOOLS%" in the command prompt, which I did, like C:\Users\Dorky>set vs90comntools=%vs100comntools%.
And tried installing Cython and Numba again ---> fail.
Not enough with that, I also went to the environment variables to set this VS90 to VS100 thing manually.
And tried installing Cython and Numba again ---> fail.
So how exactly can I solve this special "Unable to find vcvarsall.bat" problem?
What the heck is so special with this vcvarsall.bat that the user must install Microsoft's programs in order to use it?
Why not just extract out this vcvarsall.bat file as an independent file and then just copy&paste it to any file or directory that needs and not bother with the rest of the software package?
Why not the Python team just extract out this vcvarsall.bat and incorporate it into its Python packages so whenever a user installs Python, he/she will also install vcvarsall.bat along the way and then Python would also know where to look for this file in case needing to install Cython or Numba or any other?
If you're using the python.org version of Python, there's a much easier way to go about things - grab the packages you're interested in from Christoph Gohlke's Python Extension Packages for Windows repository. He has a very large selection of mainly scientific computing-based Python modules, including Cython and numba (you'll need numpy - compiled with Intel's MKL - and llvmlite - which requires this - as well). Everything is precompiled into .whl packages that can be installed with an up-to-date version of pip. Most modules are kept updated with the latest versions on PyPI or other repositories.
This is definitely my go-to site for installing packages on Windows, and if what I'm looking for isn't there, then I'll install via pip or the package source.

Installing MySQL-python with easy-install failed

I'm struggling with installing MySQL-python on my Centos VPS. I have "main" Python 2.6 (one that came automatically with CentOS) and another one I installed after (2.7). So I used this command:
easy_install-2.7 MySQL-python
But it reproduces following error:
Searching for MySQL-python
Reading https://pypi.python.org/simple/MySQL-python/
Download error on https://pypi.python.org/simple/MySQL-python/: unknown url type: https -- Some packages may not be found!
Couldn't find index page for 'MySQL-python' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: unknown url type: https -- Some packages may not be found!
No local packages or download links found for MySQL-python
error: Could not find suitable distribution for Requirement.parse('MySQL-python')
Thanks for reading my question and possibly trying to help!
Perhaps you're using an old version of easy_install, that may be the root of problem. You can follow instructions from distribute doc package, and than install pip. Since you have installed pip you can install MySQL-pythoneasily.
Maybe try use some sentence,which include mysqldb.

Python: Unable to easy_install (Windows 7 x64)

I'm running python 2.7 on Windows 7 x64, and trying to easy_install pysqlite.
With command: easy_install -U pysqlite
It exits with the error:
error: Setup script exited with error: Unable to find vcvarsall.bat
This site: http://code.google.com/p/rdflib/issues/detail?id=104#c4
suggests a workaround of installing MingGW, saying to check the g++ option on install (plus some other stuff).
Unfortunately, MingGW does not give me the option to install g++, only c++, and of course on running easy_install a second time, I get ".. command 'gcc' failed: No such file or directory". So now I am el stucko.
Any advice on how to fix this problem would be great!
Even if you install a compiler (MinGW or Visual Studio), you still have to install SQLite3 development libraries. It is a pain to build things on Windows, so I suggest that you get the unofficial pre-built Windows binaries and install it.
As an aside, you should probably consider switching to ActivePython as it includes a package manager that allows you to install pre-built modules from ActiveState's repository.
As for the particular error in question, that is a distutils bug and you should raise your concerns in the Python bug tracker.
When that says "g++ compiler" they really mean the C++ compiler, which for mingw is gcc.
You need to install the Microsoft Visual C compiler thingy (the 2010 one). And use that as your compiler for all modules. You can also mess with distuls.cfg and specify a compiler that way.

Categories