install scipy on windows with easy_install - python

I installed python 2.7 64bit on Windows 7. I later realized that my windows is 32 bit...
Python 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)] on win
32
Anyway, it is still working! I also added the python installation directory in the windows path.
Than i installed easy_install using ez_setup script. And this worked, as well
C:\Users\Myname>easy_install
error: No urls, filenames, or requirements specified (see --help)
But then I am not able to install modules as Matplolib or Scipy!
C:\Users\Massimo\Dropbox\Python>easy_install scipy
Searching for scipy
Reading https://pypi.python.org/simple/scipy/
Best match: scipy 0.13.2
Downloading https://pypi.python.org/packages/source/s/scipy/scipy-0.13.2.zip#md5
=9befa30e546fba762a0c1695a509f731
Processing scipy-0.13.2.zip
Writing c:\users\massimo\appdata\local\temp\easy_install-v3knvt\scipy-0.13.2\set
up.cfg
Running scipy-0.13.2\setup.py -q bdist_egg --dist-dir c:\users\massimo\appdata\l
ocal\temp\easy_install-v3knvt\scipy-0.13.2\egg-dist-tmp-tatxbl
Traceback (most recent call last):
File "c:\python27\scripts\easy_install-script.py", line 9, in <module>
load_entry_point('setuptools==0.8', 'console_scripts', 'easy_install')()
File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 1992
, in main
File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 1979
, in with_ei_usage
File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 1996
, in <lambda>
File "c:\python27\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "c:\python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "c:\python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 380,
in run
File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 623,
in easy_install
File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 653,
in install_item
File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 849,
in install_eggs
File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 1130
, in build_and_install
File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 1115
, in run_setup
File "build\bdist.win-amd64\egg\setuptools\sandbox.py", line 69, in run_setup
File "build\bdist.win-amd64\egg\setuptools\sandbox.py", line 120, in run
File "build\bdist.win-amd64\egg\setuptools\sandbox.py", line 71, in <lambda>
File "setup.py", line 230, in <module>
File "setup.py", line 218, in setup_package
ImportError: No module named numpy.distutils.core
Thanks.

Christoph Gohlke provides pre-built Windows installers here including scipy. Your best bet is to use one of them, the reason being that installing scipy, numpy & matplotlib from source requires building both C and Fortran extensions which most Windows machines do not have the compiler for.
Alternatively there are a number of pre-build istallations that include python and some other tools:
Anaconda: A free distribution
for the SciPy stack. Supports Linux, Windows and Mac.
Enthought Canopy: The free and
commercial versions include the core SciPy stack packages. Supports Linux,
Windows and Mac.
Python(x,y): A free distribution
including the SciPy stack, based around the Spyder IDE. Windows only.
WinPython: A free distribution
including the SciPy stack. Windows only.
Pyzo: A free distribution based on Python 3 with the IEP editor. Supports Linux and Windows.

Related

Issues installing python package Six (to install Pip)

We recently uninstalled pip to do some cleanup on Mac OS X El Capitan. Now trying to re-install pip.
$ sudo easy_install pip
Traceback (most recent call last):
File "/usr/local/bin/easy_install", line 11, in <module>
sys.exit(main())
File "/Library/Python/2.7/site-packages/setuptools/command/easy_install.py", line 2270, in main
**kw
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/Library/Python/2.7/site-packages/setuptools/dist.py", line 321, in __init__
_Distribution.__init__(self, attrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/Library/Python/2.7/site-packages/setuptools/dist.py", line 389, in finalize_options
ep.require(installer=self.fetch_build_egg)
File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 2324, in require
items = working_set.resolve(reqs, env, installer, extras=self.extras)
File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 859, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (six 1.4.1 (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python), Requirement.parse('six>=1.6.0'))
Looks like we need to upgrade Six. So:
$ easy_install --upgrade six
Traceback (most recent call last):
File "/usr/local/bin/easy_install", line 11, in <module>
sys.exit(main())
File "/Library/Python/2.7/site-packages/setuptools/command/easy_install.py", line 2270, in main
**kw
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/Library/Python/2.7/site-packages/setuptools/dist.py", line 321, in __init__
_Distribution.__init__(self, attrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/Library/Python/2.7/site-packages/setuptools/dist.py", line 389, in finalize_options
ep.require(installer=self.fetch_build_egg)
File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 2324, in require
items = working_set.resolve(reqs, env, installer, extras=self.extras)
File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 859, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (six 1.4.1 (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python), Requirement.parse('six>=1.6.0'))
Now it looks like we need to upgrade Six in order to upgrade Six??? Maybe it's just a permissions issue:
$sudo easy_install --upgrade six
Traceback (most recent call last):
File "/usr/local/bin/easy_install", line 11, in <module>
sys.exit(main())
File "/Library/Python/2.7/site-packages/setuptools/command/easy_install.py", line 2270, in main
**kw
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/Library/Python/2.7/site-packages/setuptools/dist.py", line 321, in __init__
_Distribution.__init__(self, attrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/Library/Python/2.7/site-packages/setuptools/dist.py", line 389, in finalize_options
ep.require(installer=self.fetch_build_egg)
File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 2324, in require
items = working_set.resolve(reqs, env, installer, extras=self.extras)
File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 859, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (six 1.4.1 (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python), Requirement.parse('six>=1.6.0'))
Nope. Same error.
I'm obviously missing something. Can someone shed some light on this?
Tried the first answer:
$ python get-pip.py
Collecting pip
Using cached pip-9.0.1-py2.py3-none-any.whl
Collecting wheel
Using cached wheel-0.29.0-py2.py3-none-any.whl
Installing collected packages: pip, wheel
Exception:
Traceback (most recent call last):
File "/var/folders/23/49gg72xd4wb1qps4z5j9vbz80000gy/T/tmpz5ckOD/pip.zip/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/var/folders/23/49gg72xd4wb1qps4z5j9vbz80000gy/T/tmpz5ckOD/pip.zip/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/var/folders/23/49gg72xd4wb1qps4z5j9vbz80000gy/T/tmpz5ckOD/pip.zip/pip/req/req_set.py", line 784, in install
**kwargs
File "/var/folders/23/49gg72xd4wb1qps4z5j9vbz80000gy/T/tmpz5ckOD/pip.zip/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/var/folders/23/49gg72xd4wb1qps4z5j9vbz80000gy/T/tmpz5ckOD/pip.zip/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/var/folders/23/49gg72xd4wb1qps4z5j9vbz80000gy/T/tmpz5ckOD/pip.zip/pip/wheel.py", line 247, in move_wheel_files
prefix=prefix,
File "/var/folders/23/49gg72xd4wb1qps4z5j9vbz80000gy/T/tmpz5ckOD/pip.zip/pip/locations.py", line 140, in distutils_scheme
d = Distribution(dist_args)
File "/Library/Python/2.7/site-packages/setuptools/dist.py", line 321, in __init__
_Distribution.__init__(self, attrs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/Library/Python/2.7/site-packages/setuptools/dist.py", line 389, in finalize_options
ep.require(installer=self.fetch_build_egg)
File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 2324, in require
items = working_set.resolve(reqs, env, installer, extras=self.extras)
File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 859, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
VersionConflict: (six 1.4.1 (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python), Requirement.parse('six>=1.6.0'))
Python 2.7.9+ and 3.4+
Good news! Python 3.4 (released March 2014) and Python 2.7.9 (released December 2014) ship with Pip. This is the best feature of any Python release. It makes the community's wealth of libraries accessible to everyone. Newbies are no longer excluded from using community libraries by the prohibitive difficulty of setup. In shipping with a package manager, Python joins Ruby, Node.js, Haskell, Perl, Go--almost every other contemporary language with a majority open-source community. Thank you Python.
Of course, that doesn't mean Python packaging is problem solved. The experience remains frustrating. I discuss this in Stack Overflow question Does Python have a package/module management system?.
And, alas for everyone using Python 2.7.8 or earlier (a sizable portion of the community). There's no plan to ship Pip to you. Manual instructions follow.
Python 2 ≤ 2.7.8 and Python 3 ≤ 3.3
Flying in the face of its 'batteries included' motto, Python ships without a package manager. To make matters worse, Pip was--until recently--ironically difficult to install.
Official instructions
Per https://pip.pypa.io/en/stable/installing/#do-i-need-to-install-pip:
Download get-pip.py, being careful to save it as a .py file rather than .txt. Then, run it from the command prompt:
python get-pip.py
You possibly need an administrator command prompt to do this. Follow Start a Command Prompt as an Administrator (Microsoft TechNet).
Alternative instructions
The official documentation tells users to install Pip and each of its dependencies from source. That's tedious for the experienced, and prohibitively difficult for newbies.
For our sake, Christoph Gohlke prepares Windows installers (.msi) for popular Python packages. He builds installers for all Python versions, both 32 and 64 bit. You need to
Install setuptools
Install pip
For me, this installed Pip at C:\Python27\Scripts\pip.exe. Find pip.exe on your computer, then add its folder (for example, C:\Python27\Scripts) to your path (Start / Edit environment variables). Now you should be able to run pip from the command line. Try installing a package:
pip install httpie
There you go (hopefully)! Solutions for common problems are given below:
Proxy problems
If you work in an office, you might be behind a HTTP proxy. If so, set the environment variables http_proxy and https_proxy. Most Python applications (and other free software) respect these. Example syntax:
http://proxy_url:port
http://username:password#proxy_url:port
If you're really unlucky, your proxy might be a Microsoft NTLM proxy. Free software can't cope. The only solution is to install a free software friendly proxy that forwards to the nasty proxy. http://cntlm.sourceforge.net/
Unable to find vcvarsall.bat
Python modules can be part written in C or C++. Pip tries to compile from source. If you don't have a C/C++ compiler installed and configured, you'll see this cryptic error message.
Error: Unable to find vcvarsall.bat
You can fix that by installing a C++ compiler such as MinGW or Visual C++. Microsoft actually ship one specifically for use with Python. Or try Microsoft Visual C++ Compiler for Python 2.7.
Often though it's easier to check Christoph's site for your package.

Error in installing setuptools (unorderable types: str() < NoneType())

Python 3.4.2, 32 bit - Win 8.1, 64 bit
First I was trying to upgrade setuptools, but it was not successful. So I decided to uninstall the previous version. Now I can't install setuptools. I have tried the following:
pip install setuptools:
Exception:
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\pip\basecommand.py", line 232, in main
status = self.run(options, args)
File "C:\Python34\lib\site-packages\pip\commands\install.py", line 339, in run
requirement_set.prepare_files(finder)
File "C:\Python34\lib\site-packages\pip\req\req_set.py", line 229, in prepare_
files
req_to_install.check_if_exists()
File "C:\Python34\lib\site-packages\pip\req\req_install.py", line 928, in chec
k_if_exists
self.satisfied_by = pkg_resources.get_distribution(self.req)
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", li
ne 461, in get_distribution
dist = get_provider(dist)
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", li
ne 341, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", li
ne 870, in require
needed = self.resolve(parse_requirements(requirements))
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", li
ne 740, in resolve
env = Environment(self.entries)
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", li
ne 927, in __init__
self.scan(search_path)
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", li
ne 957, in scan
self.add(dist)
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", li
ne 977, in add
dists.sort(key=operator.attrgetter('hashcmp'), reverse=True)
TypeError: unorderable types: str() < NoneType()
Running (Invoke-WebRequest https://bootstrap.pypa.io/ez_setup.py).Content | python - in a powershell with admin privileges:
PS C:\Windows\system32> > (Invoke-WebRequest https://bootstrap.pypa.io/ez_setup.py).Content | python -
Invoke-WebRequest : The response content cannot be parsed because the Internet Explorer engine is not available, or
Internet Explorer's first-launch configuration is not complete. Specify the UseBasicParsing parameter and try again.
At line:1 char:4
+ > (Invoke-WebRequest https://bootstrap.pypa.io/ez_setup.py).Content | python -
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotImplemented: (:) [Invoke-WebRequest], NotSupportedException
+ FullyQualifiedErrorId : WebCmdletIEDomNotSupportedException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
(I'm not willing to install Internet Explorer right now, but if you think I have to, then I will.)
Downloaded the ez_setup.py and ran it:
Installing Setuptools
running install
Traceback (most recent call last):
File "setup.py", line 180, in <module>
dist = setuptools.setup(**setup_params)
File "C:\Python34\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Python34\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\a\AppData\Local\Temp\tmpo7o_bqrd\setuptools-11.3.1\setuptools\c
ommand\install.py", line 67, in run
self.do_egg_install()
File "C:\Users\a\AppData\Local\Temp\tmpo7o_bqrd\setuptools-11.3.1\setuptools\c
ommand\install.py", line 103, in do_egg_install
cmd.ensure_finalized() # finalize before bdist_egg munges install cmd
File "C:\Python34\lib\distutils\cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "C:\Users\a\AppData\Local\Temp\tmpo7o_bqrd\setuptools-11.3.1\setuptools\c
ommand\easy_install.py", line 319, in finalize_options
self.index_url, search_path=self.shadow_path, hosts=hosts,
File "C:\Users\a\AppData\Local\Temp\tmpo7o_bqrd\setuptools-11.3.1\setuptools\p
ackage_index.py", line 269, in __init__
Environment.__init__(self,*args,**kw)
File "C:\Users\a\AppData\Local\Temp\tmpo7o_bqrd\setuptools-11.3.1\pkg_resource
s\__init__.py", line 975, in __init__
self.scan(search_path)
File "C:\Users\a\AppData\Local\Temp\tmpo7o_bqrd\setuptools-11.3.1\pkg_resource
s\__init__.py", line 1005, in scan
self.add(dist)
File "C:\Users\a\AppData\Local\Temp\tmpo7o_bqrd\setuptools-11.3.1\pkg_resource
s\__init__.py", line 1025, in add
dists.sort(key=operator.attrgetter('hashcmp'), reverse=True)
TypeError: unorderable types: str() < NoneType()
Something went wrong during the installation.
See the error message above.
Repairing python installation by running python-3.4.2.msi and choosing the repair option. But still no setuptools:
>pip install scipy -U
Collecting scipy from https://pypi.python.org/packages/source/s/scipy/
.0.tar.gz#md5=639112f077f0aeb6d80718dc5019dc7a
Using cached scipy-0.15.0.tar.gz
setuptools must be installed to install from a source distribution
I think uninstalling and reinstalling python would fix the problem, but before trying that I thought maybe you can help me to find the cause of the problem and the right way to fix this. Thanks.
I was able to solve my problem (on Win 8.1 64bit, Python 3.4.2) with the change suggested here:
https://bitbucket.org/pypa/setuptools/pull-request/122/ensure-py_version-and-platform-are-str-in/diff#chg-pkg_resources/init.py
Instead of downloading ez_setup.py, use get-pip.py instead. From the docs, if setuptools is not installed, it will install it first.
Since you're still getting an error, try installing pip and setuptools from Christoph Gohlke's Python Extension Packages for Windows repository. Make sure you download the 32-bit installers for Python 3.4. Once downloaded, run the .exe files and hopefully everything will be back to normal. There are tons of scientific computing packages there, so if you want numpy linked against Intel's MKL, and scipy, which uses the enhanced version of numpy, go right ahead!
Well it seemed to me that my python installation was completely messed up. It could have been related to a temporary installation of python 2 on my system a few weeks ago. Anyway, I thought it would be easier for me to just uninstall and reinstall the whole thing. So I uninstalled python and then reinstalled, but even that was not enough. Finally, I manually deleted C:\Python34 and reinstalled python and now it works fine.

Python 3.3.4 Cx_Freeze ImportError: DDL load failed: The specified module could not be found

I am attempting to use cx_Freeze to turn a .py file that I wrote in Python 3.3.4. In running the build command, I get the following error.
C:\Python33>c:\python33\python.exe setup.py build
running build
running build_exe
Traceback (most recent call last):
File "setup.py", line 22, in <module>
executables=executables
File "c:\python33\lib\site-packages\cx_Freeze\dist.py", line 365, in setup
distutils.core.setup(**attrs)
File "c:\python33\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\python33\lib\distutils\dist.py", line 930, in run_commands
self.run_command(cmd)
File "c:\python33\lib\distutils\dist.py", line 949, in run_command
cmd_obj.run()
File "c:\python33\lib\distutils\command\build.py", line 126, in run
self.run_command(cmd_name)
File "c:\python33\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python33\lib\distutils\dist.py", line 949, in run_command
cmd_obj.run()
File "c:\python33\lib\site-packages\cx_Freeze\dist.py", line 234, in run
metadata = metadata)
File "c:\python33\lib\site-packages\cx_Freeze\freezer.py", line 101, in __init
__
for n in self._GetDefaultBinPathExcludes() + binPathExcludes]
File "c:\python33\lib\site-packages\cx_Freeze\freezer.py", line 235, in _GetDe
faultBinPathExcludes
import cx_Freeze.util
ImportError: DLL load failed: The specified module could not be found.
Have I not installed cx_freeze correctly? Or am I running it all wrong?
Help is greatly appreciated.
Thanks
Well, I found an answer that works for me.
Turns out there's a bug in cx_Freeze 4.3.4 and downgrading to 4.3.3 solved this problem for me.
Try opening up the util.pyd file with a tool like Dependency Walker in order to check if the error is a result of missing dependencies. I found that it was trying to load msvcr100.dll from the Microsoft Visual C++ 2010 runtime which I did not have installed on my machine. If this is also the source of your error, you can try running the x86 / x64 installer to see if this addresses it (you want to pick the one that matches the architecture of your Python installation not of your OS).

Errors while building/installing C module for Python 2.7

I'm trying getting the following errors while trying to install/compile ctools for python (version info)
ActivePython 2.7.2.5 (ActiveState Software Inc.) based on
Python 2.7.2 (default, Jun 24 2011, 12:22:14) [MSC v.1500 64 bit (AMD64)] on win32
OS: Windows 7 Professional 64-bit (Service Pack 1)
Installed: Microsoft Visual C++ 2008 Express Edition
Error:
building 'deap.cTools' extension
Traceback (most recent call last):
File "setup.py", line 40, in <module>
cmdclass = {'build_py': build_py}
File "C:\Python27\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Python27\lib\distutils\command\install.py", line 563, in run
self.run_command('build')
File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Python27\lib\distutils\command\build.py", line 127, in run
self.run_command(cmd_name)
File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Python27\lib\distutils\command\build_ext.py", line 340, in run
self.build_extensions()
File "C:\Python27\lib\distutils\command\build_ext.py", line 449, in build_extensions
self.build_extension(ext)
File "C:\Python27\lib\distutils\command\build_ext.py", line 499, in build_extension
depends=ext.depends)
File "C:\Python27\lib\distutils\msvc9compiler.py", line 473, in compile
self.initialize()
File "C:\Python27\lib\distutils\msvc9compiler.py", line 383, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Python27\lib\distutils\msvc9compiler.py", line 299, in query_vcvarsall
raise ValueError(str(list(result.keys())))
ValueError: [u'path']
I've installed PyWin as suggested in here, but it didn't help. I'd appreciate help sorting out this issue.
Edit
Same issue arises when trying to install scikit-learn
File "C:\Python27\lib\distutils\msvc9compiler.py", line 299, in query_vcvarsall
raise ValueError(str(list(result.keys())))
ValueError: [u'path']
I summarized above in my blog.
http://springflex.blogspot.com/2014/02/how-to-fix-valueerror-when-trying-to.html
To install Visual Studio 2008 Express Edition with all required components:
Install Microsoft Visual Studio 2008 Express Edition. The main Visual Studio 2008 Express installer is available from (the C++ installer name is vcsetup.exe):
Install the Microsoft Windows SDK. The Microsoft Windows SDK is available by searching Microsoft's download site, or by going directly to:
http://www.microsoft.com/downloads/details.aspx?FamilyId=F26B1AA4-741A-433A-9BE5-FA919850BDBF&displaylang=en
To verify that you have all installed components, check that the Microsoft SDK contains the "amd64" version of the C/C++ compiler "cl.exe". This is usually installed into
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\cl.exe
copy .../VC/bin/vcvars64.bat to .../VC/bin/vcvarsamd64.bat
copy .../VC/bin/vcvars64.bat to .../VC/bin/amd64/vcvarsamd64.bat
Since you're using the 64 bit version of Python, once you have installed Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1 (which installs the 64bit compiler that isn't installed when installing Visual Studio 2008 SP1 Express Edition); You need to copy the vcvars64.bat to a location where vcvarsall.bat claims it to be.
From %CSIDL_PROGRAM_FILESX86%\Microsoft Visual Studio 9.0\VC\bin\, you need to copy vcvars64.bat to amd64\vcvarsamd64.bat.
Note the amd part in the destination file name.
Microsoft now publishes a Visual C++ compiler just for Python 2.7, although it will work for other versions of Python that used the same compiler. Check the system requirements: setuptools 6.0 or later is required. It will not work with packages using distutils.
I experienced this issue because I did not have the 64-bit version of Visual C++ 2008. To solve the issue, I installed it through Change/Remove in Programs and Features, following this answer.
I had this same problem, but just renaming the files listed above (in a somewhat opaque way) didn't work for me. What did work is a much easier solution. Just run vcvarsall.bat before you start the install. This sets the correct paths and is much easier to understand. In my case, I needed a 64 bit build so I ran:
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x64

Problem using easy_install on Windows 7, 64 bit. (cannot find python.exe)

I have just now installed Python 2.6 on my Windows 7 (64 bit) Lenovo t61p laptop.
I have downloaded Sphinx and nose and apparently installed them correctly using
python setup.py install
(at least no errors were reported during the installation).
Now I am trying to install pymongo using easy_install but I am not having much success. It seems that easy_install isn't working at all. I execute easy_install as administrator:
C:\>easy_install
Cannot find Python executable C:\Program Files\Python26\python.exe
The path C:\Program Files\Python26\python.exe is correct.
I have found this bug report on bugs.python.org which seems to be related, although its status is 'Resolved'.
Do you have any ideas as to what may be wrong? Any pointers, hints or tips for diagnosing the problem further would be greatly appreciated.
EDIT: This is the stacktrace I receive when trying to install pymongo:
C:\Users\Rune Ibsen\Documents\Downloads\pymongo-1.4>python setup.py install
running install
running bdist_egg
running egg_info
writing pymongo.egg-info\PKG-INFO
writing top-level names to pymongo.egg-info\top_level.txt
writing dependency_links to pymongo.egg-info\dependency_links.txt
reading manifest file 'pymongo.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pymongo.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
building 'pymongo._cbson' extension
Traceback (most recent call last):
File "setup.py", line 166, in <module>
"doc": doc})
File "C:\Program Files\Python26\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Program Files\Python26\lib\distutils\dist.py", line 975, in run_commands
self.run_command(cmd)
File "C:\Program Files\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "C:\Program Files\Python26\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\command\install.py", line 76, in run
File "C:\Program Files\Python26\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\command\install.py", line 96, in do_egg_install
File "C:\Program Files\Python26\lib\distutils\cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "C:\Program Files\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "C:\Program Files\Python26\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\command\bdist_egg.py", line 174, in run
File "C:\Program Files\Python26\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\command\bdist_egg.py", line 161, in call_command
File "C:\Program Files\Python26\lib\distutils\cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "C:\Program Files\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "C:\Program Files\Python26\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\command\install_lib.py", line 20, in run
File "C:\Program Files\Python26\lib\distutils\command\install_lib.py", line 113, in build
self.run_command('build_ext')
File "C:\Program Files\Python26\lib\distutils\cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "C:\Program Files\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "setup.py", line 107, in run
build_ext.run(self)
File "C:\Program Files\Python26\lib\distutils\command\build_ext.py", line 340, in run
self.build_extensions()
File "C:\Program Files\Python26\lib\distutils\command\build_ext.py", line 449, in build_extensions
self.build_extension(ext)
File "setup.py", line 117, in build_extension
build_ext.build_extension(self, ext)
File "C:\Program Files\Python26\lib\distutils\command\build_ext.py", line 499, in build_extension
depends=ext.depends)
File "C:\Program Files\Python26\lib\distutils\msvc9compiler.py", line 448, in compile
self.initialize()
File "C:\Program Files\Python26\lib\distutils\msvc9compiler.py", line 358, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Program Files\Python26\lib\distutils\msvc9compiler.py", line 274, in query_vcvarsall
raise ValueError(str(list(result.keys())))
ValueError: [u'path']
C:\Users\Rune Ibsen\Documents\Downloads\pymongo-1.4>
PS.: I previously installed Python 3.1 but later installed 2.6 because I am not sure whether pymongo supports 3.1.
PPS.: I have tried installing pymongo using the python setup.py install approach, but this resulted in a nasty-looking stack trace, so I thought I would try to let easy_install take care of it for me.
PPPS.: I am completely new to Python, easy_install, eggs etc.
I don't know anything about these specific packages so I may not be much help. But for what it's worth I have run into the "can't find python executable" errors before with 64 bit python. It happened when the package I was trying to install didn't have a 64 bit version and it was looking for 32 bit python. I ended up just installing and using the 32 bit python. That may not be the issue here, but I figured I'd through it out there.
can't help much with easy_install - but python setup.py install should work w/ pymongo. what was the stack trace?
Install this 64-bit version of setuptools instead.
http://www.lfd.uci.edu/~gohlke/pythonlibs/#setuptools

Categories