Compiler error while installing py-bcrypt in Windows 7 - python

I need to install the Flask module flask-bcrypt which requires py-bcrypt. When I try to install it, an error occurs at:
C:\Users\Param\Downloads\py-bcrypt-0.3>python setup.py install
running install
running bdist_egg
running egg_info
writing py_bcrypt.egg-info\PKG-INFO
writing top-level names to py_bcrypt.egg-info\top_level.txt
writing dependency_links to py_bcrypt.egg-info\dependency_links.txt
reading manifest file 'py_bcrypt.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'py_bcrypt.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_py
running build_ext
error: don't know how to compile C/C++ code on platform 'nt' with 'MinGW32' comp
iler
What is causing this problem?
Previously, I had installed MinGW32 in my Windows 7 64 bit machine. Is the problem occuring because MinGW is 32 bit and Windows is 64 bit? If so, what should I do to resolve this issue? (How can I use MinGW 64 bit in my machine?)

These libraries are already compiled and available somewhere. Someone already uploaded compiled versions for windows. I was able to run flask-bcrypt in Windows with the files.
You just throw it in your flask/scripts/python packages folder.
It was answered in the Flask subreddit with a location to download the libraries you need:
http://www.reddit.com/r/flask/comments/15q5xj/anyone_have_a_working_version_of_flaskbcrypt_for/

Have a loot at these MinGW binaries. It should be a version of MinGW GCC specifically taylored for building Python extension modules.
this installer tries to fix all the problems with compiling Python distutils extensions with GCC

Related

How can I use a Python module in Pydev in Aptana on Windows 7?

I'm fairly new to Pydev in Aptana Studio 3, but thanks to some great tutorial videos I've got Python 3.3 running in Pydev just fine on Windows 7.
My reason for using Aptana/Pydev is for all the linty code-tidying goodness, but the bit of code I've been given which I need to refactor uses the Rpi.GPIO module.
Works just find when I apt-get the module on the Pi, of course, but I need to do some massive tidying on Windows, then I can go back to IDLE3 on the Pi later.
It looks like you can't just dump the folder in a Pydev path and expect it to run, so I read the INSTALL readme, and the following thing happened:
D:\RPi.GPIO>python setup.py install
running install
running bdist_egg
running egg_info
writing dependency_links to RPi.GPIO.egg-info\dependency_links.txt
writing RPi.GPIO.egg-info\PKG-INFO
writing top-level names to RPi.GPIO.egg-info\top_level.txt
reading manifest file 'RPi.GPIO.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'RPi.GPIO.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
building 'RPi.GPIO' extension
error: Unable to find vcvarsall.bat
So if anyone knows how to simply get Pydev to recognise this library, I'd be very grateful.
The error:
error: Unable to find vcvarsall.bat
is happening because you don't have Visual Studio C++ compiler installed which is needed to compile the code.
Also, checkout this answer for more info.

Dropbox Python SDK installation error on Windows 7 (could not create 'build')

I was hoping to get some help. I am trying to install the Python SDK for Dropbox on Windows 7 (have Python 2.7.3 installed). Following the instructions in the readme file, I ran the following on the command prompt: "python setup.py install -f". I received the following error. Any thoughts? Many thanks in advance.
running install
running bdist_egg
running egg_info
writing dropbox_python_sdk.egg-info\PKG-INFO
writing top-level names to dropbox_python_sdk.egg-info\top_level.txt
writing dependency_links to dropbox_python_sdk.egg-info\dependency_links.txt
reading manifest file 'dropbox_python_sdk.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'dropbox_python_sdk.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_py
creating build
error: could not create 'build': Cannot create a file when that file already exists
Sorry...I figured it out. I guess I goofed something up in the download/extraction process as I started from scratch and it worked this time around. 8)

Heroku Django app development on Windows

I'm trying to start a Django app on Heroku using Windows and I'm getting stuck on the following error when I try to pip install psycopg2:
Downloading/unpacking psycopg2
Downloading psycopg2-2.4.5.tar.gz (719Kb): 719Kb downloaded
Running setup.py egg_info for package psycopg2
Error: pg_config executable not found.
Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info\psycopg2.egg-info
writing pip-egg-info\psycopg2.egg-info\PKG-INFO
writing top-level names to pip-egg-info\psycopg2.egg-info\top_level.txt
writing dependency_links to pip-egg-info\psycopg2.egg-info\dependency_links.txt
writing manifest file 'pip-egg-info\psycopg2.egg-info\SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
I've googled the error and it seems you need libpq-dev python-dev as dependencies for postgres under Python. I also turned up a link that says you gt into trouble if you don't have the postgres bin folder in your Path so I installed Postgres manually and tried again. This time I get:
error: Unable to find vcvarsall.bat
I am still a python N00b so I am lost. Could someone point me in a general direction?
You can use Cygwin and install all the dependencies, but I went through that issue last week and then I realized it was far easier to use a Virtual Box with Ubuntu as my Guest OS. I still did the development on Windows but used Ubuntu just to communicate/push to heroku
I found the answer to my problem. I believe the problem is that pip is looking to compile the dependency from source. The solution is to find a link to pre-compiled version of the dependency. You can then pass this link to the easyinstall library installed in your virtualenv. Easyinstall will download and install the pre-compiled version of the dependency.

Python: How to install mysqldb on windows 7 x64?

Im trying install Mysql-python on windows x64.
I installed python x64, setuptools (checked on the leaf lib, successfully installed) but i can't install mysqldb.
I trying to execute
C:\Users\Fedcomp\Desktop\leaf-0.4\MySQL-python-1.2.3>python
setup.py install
but catch this
In file included from _mysql.c:34:
D:\servers\xampp_server\xampp\mysql\include/config-win.h:211:1: warning: "finite
" redefined
D:\servers\xampp_server\xampp\mysql\include/config-win.h:164:1: warning: this is
the location of the previous definition
D:\servers\xampp_server\xampp\mysql\include/config-win.h:277:1: warning: "HAVE_S
TDDEF_H" redefined
In file included from D:\Python27\include/Python.h:8,
from pymemcompat.h:10,
from _mysql.c:29:
D:\Python27\include/pyconfig.h:673:1: warning: this is the location of the previ
ous definition
error: command 'gcc' failed with exit status 1
also trying with msvc but catch this (MS Visual express installed)
C:\Users\Fedcomp\Desktop\leaf-0.4\MySQL-python-1.2.3>python setup.py install bui
ld --compiler=msvc
running install
running bdist_egg
running egg_info
writing MySQL_python.egg-info\PKG-INFO
writing top-level names to MySQL_python.egg-info\top_level.txt
writing dependency_links to MySQL_python.egg-info\dependency_links.txt
reading manifest file 'MySQL_python.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'MANIFEST'
warning: no files found matching 'ChangeLog'
warning: no files found matching 'GPL'
writing manifest file 'MySQL_python.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
copying MySQLdb\release.py -> build\lib.win-amd64-2.7\MySQLdb
running build_ext
building '_mysql' extension
error: Unable to find vcvarsall.bat
How to install mysqldb correctly on windows x64?
(headers from original mysql installation because, in xampp server they doesn't exist)
Or may someone compile mysqldb for windows python x64 or python x86?
EDIT: mysqlclient has binary packages for both 32bit and 64bit on PyPI. It's a fork of MySQL-python, which hasn't seen a release since 2014.
Original answer left for posterity:
You can find binary installers here (Python 2.6-3.2), here (2.7) or here (2.6). Note that you don't have to use 64bit Python on Windows x64. You can just as well use a 32bit build of Python, for which there are more pre-built 3rd party packages around.
I'm not 100% sure, but I think your path variables are to blame. It seems the compiler isn't found, run a search for vcvarsall.bat and double click it, it should correctly set your path variables. And then try to install again your package.
If you can't find vcvarsall.bat, reinstall MS Visual Express again.
"Unable to find vcvarsall.bat" means that you haven't got the necessary Visual Studio directories in your path.
However, if you are using 64 bit Python then you'll need a 64 bit compiler and Express doesn't come in 64 bit flavours. You could download the SDK MSVC compiler and get that configured but its very hard work.
If I was you I'd switch to 32 bit Python and you can almost surely get pre-built binaries.
EDIT
Pre-built 64 bit binaries as found by piquadrat would be even simpler!

Error when install python mysql module on windows?

When i try to install mysql on windows i get this error
MySQL-python-0.9.2>python setup.py build
running build
running build_py
running build_ext
building '_mysql' extension
error: Unable to find vcvarsall.bat
I guess, you don't have visual c++ compiler installed or compiler not in the PATH.
If you have mingw32, you can pass paramter -c mingw32
And mysql-python is available as binary in windows, you may not need to compile yourself.
UPDATE: OP is using python 2.6, no binaries for 1.2.3 in mysql-python page for windows.
Here is the one I have compiled before

Categories

Resources