I'm trying to install PYMC on a Win7-64 machine, using Python 2.7.3, installed as part of Python(x, y).
I've attempted to use python setup.py install, but that didn't work. I then went down the route of installing MinGW and MSYS as per these instructions http://pymc-devs.github.io/pymc/INSTALL.html, but I still have the error message below. I have added the details to my path.
I have also tried using the MCMC linked to via https://groups.google.com/forum/#!searchin/pymc/install$20windows/pymc/_10AZdgd620/wFPh4qium8QJ and the additional compiler details listed here https://groups.google.com/forum/#!topic/pymc/1-ENfS5NBQE and here http://ultrainfinitum.blogspot.co.uk/2012/12/python-error-unable-to-find-vcvarsallbat.html, which state to use the following compiler commands, setup.py install build --compiler=mingw32 or python setup.py build --force -c mingw32, then python setup.py install --force --skip-build.
The error message I'm getting is as follows:
error: Setup script exited with error: Unable to find vcvarsall.bat
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "c:\Python27\lib\atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "c:\Python27\lib\multiprocessing\util.py", line 284, in _exit_function
info('process shutting down')
TypeError: 'NoneType' object is not callable
Error in sys.exitfunc:
Traceback (most recent call last):
File "c:\Python27\lib\atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "c:\Python27\lib\multiprocessing\util.py", line 284, in _exit_function
info('process shutting down')
TypeError: 'NoneType' object is not callable
Any ideas on what to try next?
Quick Solution (with Visual Studio Express)
Install Visual Studio Express. This will give you all the vcvarsall.* dependencies.
Using MinGW
Make sure to select the C, C++ and other dev tools to ensure you get make.exe.
After this, set your PATH to include MinGW32's bin directory as well as msys\1.0\bin
Edit the distutils.cfg file located at C:\Python26\Lib\distutils\distutils.cfg to set your compiler options.
[build]
compiler=mingw32
Related
From last week, I tried to solve this but couldn't fix this error. While, I tried to install, following error comes:
C:\Users\#######>pip install pyproj
Collecting pyproj
Using cached pyproj-1.9.5.1.tar.gz
Complete output from command python setup.py egg_info:
using bundled proj4..
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\H~1\AppData\Local\Temp\pip-build-e4o66o1z\pyproj\setup.py", line 72, in <module>
objects = cc.compile(['nad2bin.c', 'src/pj_malloc.c'])
File "C:\Users\######\Anaconda3\lib\distutils\_msvccompiler.py", line 317, in compile
self.initialize()
File "C:\Users\########\Anaconda3\lib\distutils\_msvccompiler.py", line 210, in initialize
vc_env = _get_vc_env(plat_spec)
File "C:\Users\#######\Anaconda3\lib\distutils\_msvccompiler.py", line 85, in _get_vc_env
raise DistutilsPlatformError("Unable to find vcvarsall.bat")
distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\H~1\AppData\Local\Temp\pip-build-e4o66o1z\pyproj\
I couldn't proceed ahead without fixing this error. I have installed Microsoft Visual C++.
Installing some Python packages under Windows can be troublesome. You can find a precompiled package at
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyproj
Just download the .whl file that suits your Python version then install it using
pip install <filename>.whl
Error in command: python setup.py install
I am not getting the error. Please help
This is the error
>bash-4.2# python setup.py install
>ERROR:root:Error parsing
Traceback (most recent call last):
File "/sagar/nova/pbr-0.10.7-py2.7.egg/pbr/core.py", line 104, in pbr
attrs = util.cfg_to_args(path)
File "/sagar/nova/pbr-0.10.7-py2.7.egg/pbr/util.py", line 238, in cfg_to_args
>pbr.hooks.setup_hook(config)
File "/sagar/nova/pbr-0.10.7-py2.7.egg/pbr/hooks/__init__.py", line 27, in setup_hook
metadata_config.run()
File "/sagar/nova/pbr-0.10.7-py2.7.egg/pbr/hooks/base.py", line 29, in run
self.hook()
File "/sagar/nova/pbr-0.10.7-py2.7.egg/pbr/hooks/metadata.py", line 28, in hook
self.config['name'], self.config.get('version', None))
File "/sagar/nova/pbr-0.10.7-py2.7.egg/pbr/packaging.py", line 554, in get_version
raise Exception("Versioning for this project requires either an sdist"
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. Are you sure that git is installed? error in setup command:
Error parsing /sagar/nova/setup.cfg:
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. Are you sure that git is installed?
I think you haven't added git in PATH variable. I was facing similar issue myself while installing nova on Hyper V. Just updating the PATH variable did the trick
I'm trying to install matplotlib on windows using easy-install and also I tried pip, but I'm getting the error below, how can I fix this
error: Setup script exited with error: Could not initialize compiler instance: do you have Visual Studio installed? If you are trying to build with mingw, please use python setup.py
build -c mingw32 instead. If you have Visual Studio installed, check it is
correctly installed, and the right version (VS 2008 for python 2.6, VS 2003 for
2.5, etc...). Original exception was: Unable to find vcvarsall.bat, and the Compiler class was MSVCCompiler
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "C:\Python26\lib\atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "C:\Python26\lib\multiprocessing\util.py", line 270, in _exit_function
info('process shutting down')
TypeError: 'NoneType' object is not callable
Error in sys.exitfunc:
Traceback (most recent call last):
File "C:\Python26\lib\atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "C:\Python26\lib\multiprocessing\util.py", line 270, in _exit_function
info('process shutting down')
TypeError: 'NoneType' object is not callable
C:\Python26\Scripts>
Compiling C extensions on Windows requires VisualStudio Express in the most cases and will be far from easy. Instead you can download the binary package for your Python version to a local directory and install with easy_install like so:
easy_install "C:\path_to_local_binary_dir\matplotlib-1.3.1-win-xxx.exe"
(replace with full path/filename). This will not show up in Add/Remove programs and also works for virtual envs.
I tried to run the following command, in the folder of my Django project:
$ python manage.py dbshell
It shows me this error:
$python manage.py dbshell
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "C:\Python25\lib\site-packages\django\core\management\__init__.py", line
362, in execute_manager
utility.execute()
File "C:\Python25\lib\site-packages\django\core\management\__init__.py", line
303, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python25\lib\site-packages\django\core\management\base.py", line 195,
in run_from_argv
self.execute(*args, **options.__dict__)
File "C:\Python25\lib\site-packages\django\core\management\base.py", line 222,
in execute
output = self.handle(*args, **options)
File "C:\Python25\lib\site-packages\django\core\management\base.py", line 351,
in handle
return self.handle_noargs(**options)
File "C:\Python25\lib\site-packages\django\core\management\commands\dbshell.py
", line 9, in handle_noargs
from django.db import connection
File "C:\Python25\lib\site-packages\django\db\__init__.py", line 41, in <modul
e>
backend = load_backend(settings.DATABASE_ENGINE)
File "C:\Python25\lib\site-packages\django\db\__init__.py", line 17, in load_b
ackend
return import_module('.base', 'django.db.backends.%s' % backend_name)
File "C:\Python25\Lib\site-packages\django\utils\importlib.py", line 35, in im
port_module
__import__(name)
File "C:\Python25\lib\site-packages\django\db\backends\mysql\base.py", line 13
, in <module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No mo
dule named MySQLdb
First question is, why does Python not simply include this MySQLdb module?
OK, just fine, try to search to solve this message.
I have looked around stackoverflow.com for installing this module but did not have a good result.
Download this module at: http://sourceforge.net/projects/mysql-python/
Comes to the installation of this module on my Windows Vista system.
After the extraction of the package, I run the cmd prompt to continue with the installation:
$ python setup.py install
Again it showed me one other message:
D:\SOFTWARE\PROGRAMMING\MySQL-python-1.2.3c1>python setup.py install
Traceback (most recent call last):
File "setup.py", line 5, in <module>
from setuptools import setup, Extension
ImportError: No module named setuptools
Playing around with this error message, I know that there is the ez_setup.py within the package:
$python ez_setup.py
It seems that everything is OK:
D:\SOFTWARE\PROGRAMMING\MySQL-python-1.2.3c1>python ez_setup.py
Downloading http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c9-py
2.5.egg
Processing setuptools-0.6c9-py2.5.egg
Copying setuptools-0.6c9-py2.5.egg to c:\python25\lib\site-packages
Adding setuptools 0.6c9 to easy-install.pth file
Installing easy_install-script.py script to C:\Python25\Scripts
Installing easy_install.exe script to C:\Python25\Scripts
Installing easy_install-2.5-script.py script to C:\Python25\Scripts
Installing easy_install-2.5.exe script to C:\Python25\Scripts
Installed c:\python25\lib\site-packages\setuptools-0.6c9-py2.5.egg
Processing dependencies for setuptools==0.6c9
Finished processing dependencies for setuptools==0.6c9
Now comes back to the setup.py to install again:
$python setup.py install
It again gave me one other error message:
D:\SOFTWARE\PROGRAMMING\MySQL-python-1.2.3c1>python setup.py install
running install
running bdist_egg
....
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-2.5\MySQLdb\constants
running build_ext
error: Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.
How can I fix this problem?
Did you try looking here: http://sourceforge.net/projects/mysql-python/files/
That is the download area of MySQLdb project, it has nothing to do with django, so your question is incorrect - django does not make switching database backends hard, you just change one line. And of course, your python installation should support that database first, so by downloading binary package for Windows from the link I gave above (chose correct version to match your version of python) you can avoid all the hassle of compiling the source release.
Most probably you need either MySQL-python-1.2.2.win32-py2.5.exe or MySQL-python-1.2.2.win32-py2.4.exe
Uh, this isn't Django, this is you downloading some unspecified Python environment and expecting it to magically do everything exactly the way you wanted it to. Find a good tutorial on this and follow the instructions.
BTW, this is a very helpful forum, but giving no specifics and then delivering a non-question with an attitude is not a good way to get people to feel helpful.
I once had the same problem running Python and MySQL on the same computer. Like the guys/gals said above, Python does not come with built-in support for MySQL, so you will need to download the connectors.
The link given above by #kibitzer will most likely not work on Windows successfully, so go here to download a copy of the connector that works with windows. It comes with installer and no need to run setup.py script manually.
I tried to run the following command, in the folder of my Django project:
$ python manage.py dbshell
It shows me this error:
$python manage.py dbshell
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "C:\Python25\lib\site-packages\django\core\management\__init__.py", line
362, in execute_manager
utility.execute()
File "C:\Python25\lib\site-packages\django\core\management\__init__.py", line
303, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python25\lib\site-packages\django\core\management\base.py", line 195,
in run_from_argv
self.execute(*args, **options.__dict__)
File "C:\Python25\lib\site-packages\django\core\management\base.py", line 222,
in execute
output = self.handle(*args, **options)
File "C:\Python25\lib\site-packages\django\core\management\base.py", line 351,
in handle
return self.handle_noargs(**options)
File "C:\Python25\lib\site-packages\django\core\management\commands\dbshell.py
", line 9, in handle_noargs
from django.db import connection
File "C:\Python25\lib\site-packages\django\db\__init__.py", line 41, in <modul
e>
backend = load_backend(settings.DATABASE_ENGINE)
File "C:\Python25\lib\site-packages\django\db\__init__.py", line 17, in load_b
ackend
return import_module('.base', 'django.db.backends.%s' % backend_name)
File "C:\Python25\Lib\site-packages\django\utils\importlib.py", line 35, in im
port_module
__import__(name)
File "C:\Python25\lib\site-packages\django\db\backends\mysql\base.py", line 13
, in <module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No mo
dule named MySQLdb
First question is, why does Python not simply include this MySQLdb module?
OK, just fine, try to search to solve this message.
I have looked around stackoverflow.com for installing this module but did not have a good result.
Download this module at: http://sourceforge.net/projects/mysql-python/
Comes to the installation of this module on my Windows Vista system.
After the extraction of the package, I run the cmd prompt to continue with the installation:
$ python setup.py install
Again it showed me one other message:
D:\SOFTWARE\PROGRAMMING\MySQL-python-1.2.3c1>python setup.py install
Traceback (most recent call last):
File "setup.py", line 5, in <module>
from setuptools import setup, Extension
ImportError: No module named setuptools
Playing around with this error message, I know that there is the ez_setup.py within the package:
$python ez_setup.py
It seems that everything is OK:
D:\SOFTWARE\PROGRAMMING\MySQL-python-1.2.3c1>python ez_setup.py
Downloading http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c9-py
2.5.egg
Processing setuptools-0.6c9-py2.5.egg
Copying setuptools-0.6c9-py2.5.egg to c:\python25\lib\site-packages
Adding setuptools 0.6c9 to easy-install.pth file
Installing easy_install-script.py script to C:\Python25\Scripts
Installing easy_install.exe script to C:\Python25\Scripts
Installing easy_install-2.5-script.py script to C:\Python25\Scripts
Installing easy_install-2.5.exe script to C:\Python25\Scripts
Installed c:\python25\lib\site-packages\setuptools-0.6c9-py2.5.egg
Processing dependencies for setuptools==0.6c9
Finished processing dependencies for setuptools==0.6c9
Now comes back to the setup.py to install again:
$python setup.py install
It again gave me one other error message:
D:\SOFTWARE\PROGRAMMING\MySQL-python-1.2.3c1>python setup.py install
running install
running bdist_egg
....
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-2.5\MySQLdb\constants
running build_ext
error: Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.
How can I fix this problem?
Did you try looking here: http://sourceforge.net/projects/mysql-python/files/
That is the download area of MySQLdb project, it has nothing to do with django, so your question is incorrect - django does not make switching database backends hard, you just change one line. And of course, your python installation should support that database first, so by downloading binary package for Windows from the link I gave above (chose correct version to match your version of python) you can avoid all the hassle of compiling the source release.
Most probably you need either MySQL-python-1.2.2.win32-py2.5.exe or MySQL-python-1.2.2.win32-py2.4.exe
Uh, this isn't Django, this is you downloading some unspecified Python environment and expecting it to magically do everything exactly the way you wanted it to. Find a good tutorial on this and follow the instructions.
BTW, this is a very helpful forum, but giving no specifics and then delivering a non-question with an attitude is not a good way to get people to feel helpful.
I once had the same problem running Python and MySQL on the same computer. Like the guys/gals said above, Python does not come with built-in support for MySQL, so you will need to download the connectors.
The link given above by #kibitzer will most likely not work on Windows successfully, so go here to download a copy of the connector that works with windows. It comes with installer and no need to run setup.py script manually.