Issues installing scipy using Python - python

I've tried pip install scipy. I've tried all the suggestions on stackOverflow like updating pip, installing scipy manually through its website. I've tried getting it from github directly.
These are some of the errors I keep getting:
-When I try pip install:
Command "C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\us
ers\\kathyz~1\\appdata\\local\\temp\\pip-build-gmb8oc\\scipy\\setup.py';exec(com
pile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __f
ile__, 'exec'))" install --record c:\users\kathyz~1\appdata\local\temp\pip-gndjc
d-record\install-record.txt --single-version-externally-managed --compile" faile
d with error code 1 in c:\users\kathyz~1\appdata\local\temp\pip-build-gmb8oc\sci
py
-When I try through git:
Exception: Cython either isn't installed or it failed.
Cythonizing sources
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\kathyz~1\appdata\local\temp\pip-49aa2n-build\setup.py", lin
e 253, in <module>
setup_package()
File "c:\users\kathyz~1\appdata\local\temp\pip-49aa2n-build\setup.py", lin
e 246, in setup_package
generate_cython()
File "c:\users\kathyz~1\appdata\local\temp\pip-49aa2n-build\setup.py", lin
e 164, in generate_cython
raise RuntimeError("Running cythonize failed!")
RuntimeError: Running cythonize failed!
----------------------------------------
Command "C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\us
ers\\kathyz~1\\appdata\\local\\temp\\pip-49aa2n-build\\setup.py';exec(compile(ge
tattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__,
'exec'))" install --record c:\users\kathyz~1\appdata\local\temp\pip-92weib-recor
d\install-record.txt --single-version-externally-managed --compile" failed with
error code 1 in c:\users\kathyz~1\appdata\local\temp\pip-49aa2n-build
So after getting error about cythonize, I tried installing it, which led to another error:
warning: no files found matching '*.pyx' under directory 'Cython\Debugger\Tests'
warning: no files found matching '*.pxd' under directory 'Cython\Debugger\Tests'
warning: no files found matching '*.h' under directory 'Cython\Debugger\Tests'
warning: no files found matching '*.pxd' under directory 'Cython\Utility'
error: Setup script exited with error: Unable to find vcvarsall.bat

Related

Unable to get Python "ibm_db" module using pip install

I am trying to install ibm_db module for python using pip install but getting below error.
" C:\Users\n087514>pip install ibm_db Collecting ibm-db Using cached
https://repo-man.aetna.com/nexus/repository/ae-pypi-group/packages/f8/6f/5f8186cb31021409235a948be5e29d77761ef92747a101360003747c4105/ibm_db-2.0.8.tar.gz
Installing collected packages: ibm-db Running setup.py install for
ibm-db ... error
Complete output from command "c:\program files (x86)\python 3.5\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\n087514\AppData\Local\Temp\pip-build-_w1_snzp\ibm-db\setup.py';exec(compile(getattr(tokenize,
'open', open)(file).read().replace('\r\n', '\n'), file,
'exec'))" install --record
C:\Users\n087514\AppData\Local\Temp\pip-g_xrj1vq-record\install-record.txt
--single-version-externally-managed --compile:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\n087514\AppData\Local\Temp\pip-build-_w1_snzp\ibm-db\setup.py",
line 17, in
os.rename('tests','test_2')
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'tests' -> 'test_2'
---------------------------------------- Command ""c:\program files (x86)\python 3.5\python.exe" -u -c "import setuptools,
tokenize;file='C:\Users\n087514\AppData\Local\Temp\pip-build-_w1_snzp\ibm-db\setup.py';exec(compile(getattr(tokenize,
'open', open)(file).read().replace('\r\n', '\n'), file,
'exec'))" install --record
C:\Users\n087514\AppData\Local\Temp\pip-g_xrj1vq-record\install-record.txt
--single-version-externally-managed --compile" failed with error code 1 in C:\Users\n087514\AppData\Local\Temp\pip-build-_w1_snzp\ibm-db\"
Anyone has any idea what needs to be done?
Thanks in advance!
Try:
pip install "ibm_db==2.0.8a"

Unable to download a package using Pip : says Cython not installed when it is

I am trying to download the pyahocorasick package on my Windows 10 system using pip.
On my command line, I wrote-
pip install pyahocorasick
It gave the following output -
Collecting pyahocorasick
Using cached pyahocorasick-1.1.4.tar.bz2
Installing collected packages: pyahocorasick
Running setup.py install for pyahocorasick ... error
Complete output from command c:\python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Krishna\\AppData\\Local\\Temp\\pip-build-b7a1mq0t\\pyahocorasick\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Krishna\AppData\Local\Temp\pip-3iv3a5oc-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
failed to import Cython: DLL load failed: %1 is not a valid Win32 application.
error: Cython does not appear to be installed
----------------------------------------
Command "c:\python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Krishna\\AppData\\Local\\Temp\\pip-build-b7a1mq0t\\pyahocorasick\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Krishna\AppData\Local\Temp\pip-3iv3a5oc-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Krishna\AppData\Local\Temp\pip-build-b7a1mq0t\pyahocorasick\
Then I tried to see if Cython is in fact installed, so I wrote-
Cython version
and the output was -
Traceback (most recent call last):
File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "C:\Python34\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Python34\Scripts\cython.exe\__main__.py", line 5, in <module>
File "C:\Python34\lib\site-packages\Cython\Compiler\Main.py", line 28, in <module>
from .Scanning import PyrexScanner, FileSourceDescriptor
ImportError: DLL load failed: %1 is not a valid Win32 application.
And finally I tried -
install Cython
And the output was -
Requirement already satisfied: Cython in c:\python34\lib\site-packages
So my question is - if Cython is already installed, why does installing the package pyahocorasick give the error - Cython does not appear to be installed? And how can I fix this problem?

Installation error for language_check in python 2.7

I have tried to install language_check library in Python 2.7 by using...
pip install language_check
and...
pip install language_check --upgrade
In both cases, I get the following error...
Collecting language-check
Using cached language-check-0.8.tar.gz
Installing collected packages: language-check
Running setup.py install for language-check
Complete output from command "C:\Users\Gaurav M\Anaconda\python.exe" -c "import setuptools, tokenize;__file__='c:\\users\\gaurav~1\\appdata\\local\\temp\\pip-build-ew9qcy\\language-check\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\gaurav~1\appdata\local\temp\pip-b0zy9n-record\install-record.txt --single-version-externally-managed --compile:
Downloading 'LanguageTool-3.2.zip' (87.3 MiB)...
100%
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\gaurav~1\appdata\local\temp\pip-build-ew9qcy\language-check\setup.py", line 597, in <module>
sys.exit(main())
File "c:\users\gaurav~1\appdata\local\temp\pip-build-ew9qcy\language-check\setup.py", line 592, in main
run_setup_hooks(config)
File "c:\users\gaurav~1\appdata\local\temp\pip-build-ew9qcy\language-check\setup.py", line 561, in run_setup_hooks
language_tool_hook(config)
File "c:\users\gaurav~1\appdata\local\temp\pip-build-ew9qcy\language-check\setup.py", line 586, in language_tool_hook
download_lt()
File "download_lt.py", line 158, in download_lt
os.path.join(PACKAGE_PATH, dirname))
WindowsError: [Error 5] Access is denied
----------------------------------------
Command ""C:\Users\Gaurav M\Anaconda\python.exe" -c "import setuptools, tokenize;__file__='c:\\users\\gaurav~1\\appdata\\local\\temp\\pip-build-ew9qcy\\language-check\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\gaurav~1\appdata\local\temp\pip-b0zy9n-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\gaurav~1\appdata\local\temp\pip-build-ew9qcy\language-check
I also tried doing...
easy_install language_check
and that throws a different error...
Downloading https://pypi.python.org/packages/05/2e/471a9104b0fe7bb404de6d79e2fdd0c41ad08b87a16cbb4c8c5c9300a608/language-check-0.8.tar.gz#md5=8b4e3aa5e77bff1e33d3312a6dae870b
Processing language-check-0.8.tar.gz
Writing c:\users\gaurav~1\appdata\local\temp\easy_install-qkjgfj\language-check-0.8\setup.cfg
Running language-check-0.8\setup.py -q bdist_egg --dist-dir c:\users\gaurav~1\appdata\local\temp\easy_install-qkjgfj\language-check-0.8\egg-dist-tmp-py6mda
Downloading 'LanguageTool-3.2.zip' (87.3 MiB)...
100%
error: [Error 145] The directory is not empty <built-in function rmdir> c:\users\gaurav~1\appdata\local\temp\easy_install-qkjgfj\language-check-0.8\language_check\LanguageTool-3.2\org\languagetool\rules\uk
How do I install language_check in this case?
I check the sources of the file download_lt.py (github language_check).
It appears that the error occurs when you try to move the folder language_check/LanguageTool-X.Y with the command os.rename() from your TemporaryFile to your Anaconda Lib folder.
So far, #Orions is right, it is a permission problem.
Firstly, you should check your folder permission:
Go to your Local folder (should be C:\Users\Gaurav M\AppData\Local)
Right-click on Temp folder on select properties
Go to Security tab and Edit and Add your name if it doesn't appear under Group or user names.
Repeat the operation for your Anaconda folder. (should be C:\Users\Gaurav M\Anaconda)
Secondly, you can try:
pip install --user language_check
But the pip --user option install the package only for the user.
Install to the Python user install directory for your platform. Typically ~/.local/, or %APPDATA%Python on Windows. (See the Python documentation for site.USER_BASE for full details.)
Last but not least,
I presume you are using cmd or powershellas Command-line interpreter.
In my opinion, using cygwin on Windows makes a lot of things easier. Although It could be painful to configure, I would recommend a pre-configure cygwin solution like Babun.
Good luck!

OS X Pillow installation error

I followed this instructions: http://pillow.readthedocs.org/en/latest/installation.html#mac-os-x-installation
$ sudo pip install Pillow
returned error:
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-bAG3wP-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/Pillow
Storing debug log for failure in /var/root/Library/Logs/pip.log
in pip.log:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Library/Python/2.7/site-packages/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/Library/Python/2.7/site-packages/pip/req.py", line 706, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/Library/Python/2.7/site-packages/pip/util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-bAG3wP-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/Pillow
Please, help me!
UPDATE:
I installed PIL before. After installation I tried some black magic to make PIL work with libjpeg. And then I tried to reinstall PIL. It was uninstalled, but failed to install.
There seems to be something broken when running XCode 5.1. Had the same problem when installing pycrypto.
Try this:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install Pillow

Cannot install lxml 3.3.3 on OSX 10.9 with buildout

Have seen numerous related posts but not had any luck getting this to work. Log shows:
We have no distributions for lxml that satisfies 'lxml'.
Getting distribution for 'lxml'.
Running easy_install:
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python" "-c" "from setuptools.command.easy_install import main; main()" "-mZUNxd" "/Users/brad/Development/python/eggs/tmpLpoVC3" "-q" "/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/tmpZx0t7aget_dist/lxml-3.3.3.tar.gz"
path=/Users/brad/Development/python/eggs/setuptools-0.7.2-py2.7.egg
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
In file included from src/lxml/lxml.etree.c:346:
/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/easy_install-XSC3pm/lxml-3.3.3/src/lxml/includes/etree_defs.h:9:10: fatal error: 'libxml/xmlversion.h' file not found
#include "libxml/xmlversion.h"
^
1 error generated.
error: Setup script exited with error: command '/usr/bin/clang' failed with exit status 1Building lxml version 3.3.3.
Building without Cython.
ERROR: /bin/sh: xslt-config: command not found
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
An error occurred when trying to install lxml 3.3.3. Look above this message for any errors that were output by easy_install.
While:
Installing pydev.
Getting distribution for 'lxml'.
Error: Couldn't install: lxml 3.3.3
Tried answers from Cannot install Lxml on Mac os x 10.9.
xcode-select --install worked initially until an XCode upgrade to 10.5. Then hasn't worked since (even after retrying this line). Now I always get Can't install the software because it is not currently available from the Software Update server
Tried this STATIC_DEPS=true pip install lxml. It installed with error:
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip_build_brad/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip-4lSNM3-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip_build_brad/lxml
Storing debug log for failure in /Users/brad/Library/Logs/pip.log
That log file ends with:
Cleaning up...
Removing temporary dir /private/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip_build_brad...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip_build_brad/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip-4lSNM3-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip_build_brad/lxml
Exception information:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 706, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip_build_brad/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip-4lSNM3-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip_build_brad/lxml
Creating the symlink (https://stackoverflow.com/a/19549645/1399659) didn't help either.
Ideas appreciated, thanks
Ok, so coming back to this with fresh eyes, again, managed to resolve it.
The error clang: error: unknown argument: '-mno-fused-madd' during the pip install lxml above was the clincher. I'd spotted it and https://stackoverflow.com/a/22578811/1399659, but couldn't get another python version to work. Had tried MacPorts and Homebrew.
Finally a tip from https://stackoverflow.com/a/17439319/1399659 led me to removing macport's lxml and the system-installed pip. Then installing HomeBrew's python over fresh (with occasional forced linking), let me use it's installed pip to run bog-standard pip install lxml
Now running Homebrew's python 2.7.6 and pip, which was used to install lxml 3.3.3

Categories