I tried to install python dateutil for my django tastypie but unsuccessful,
http://labix.org/python-dateutil#head-2f49784d6b27bae60cde1cff6a535663cf87497b
I downloaded the tar file in c:/python27 and unzipped it,
I get the following error msg,
**C:\Python27\Scripts>**easy_install dateutil-1.5
Searching for dateutil-1.5
Reading http://pypi.python.org/simple/dateutil-1.5/
Couldn't find index page for 'dateutil-1.5' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for dateutil-1.5
Best match: None
Traceback (most recent call last):
File "C:\Python27\Scripts\easy_install-script.py", line 8, in <module>
load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 171
2, in main
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 170
0, in with_ei_usage
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 171
6, 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.linux-i686/egg/setuptools/command/easy_install.py", line 211
, in run
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 434
, in easy_install
File "build/bdist.linux-i686/egg/setuptools/package_index.py", line 475, in fe
tch_distribution
AttributeError: 'NoneType' object has no attribute 'clone'
This will install tastypie and its dependencies:
$ easy_install pip
$ pip install django-tastypie
To get only dateutil:
$ pip install python-dateutil
I am not sure if this is different on Windows, but it does not appear you are referencing an actual link (see the Reading line). Instead, try this:
easy_install python-dateutil
That will (hopefully) get the package you need. Also, see this post for what looks like a similar issue.
On Windows:
Simply use following code,
$ pip install python-dateutil
If you want with easy_install try below command,( run Command Prompt CMD as Administrator )
$ easy_install python-dateutil
On Ubuntu:
For Ubuntu OS use following code,
sudo apt-get install python-dateutil
Related
I am using Python 3.7.0a2 and Django (2, 0, 2, 'final', 0) in Windows 10.
while I was migrating my project I got the following error:
ERRORS:
accounts.UserProfile.image: (fields.E210) Cannot use ImageField because Pillow is not installed.
HINT: Get Pillow at https://pypi.python.org/pypi/Pillow or run command "pip install Pillow".
Then I ran the 'pip install Pillow' command and I got the following error:
Traceback (most recent call last):
File "C:\Users\VIKASV~1\AppData\Local\Temp\pip-build-hfzb5tde\pillow\setup.py", line 792, in <module>
zip_safe=not (debug_build() or PLATFORM_MINGW), )
File "c:\users\vikas visking\appdata\local\programs\python\python37\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\vikas visking\appdata\local\programs\python\python37\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\users\vikas visking\appdata\local\programs\python\python37\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\vikas visking\appdata\local\programs\python\python37\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\vikas visking\appdata\local\programs\python\python37\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\vikas visking\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\vikas visking\appdata\local\programs\python\python37\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\vikas visking\appdata\local\programs\python\python37\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\vikas visking\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\vikas visking\appdata\local\programs\python\python37\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\vikas visking\appdata\local\programs\python\python37\lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "C:\Users\VIKASV~1\AppData\Local\Temp\pip-build-hfzb5tde\pillow\setup.py", line 580, in build_extensions
raise RequiredDependencyException(f)
__main__.RequiredDependencyException: zlib
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\VIKASV~1\AppData\Local\Temp\pip-build-hfzb5tde\pillow\setup.py", line 804, in <module>
raise RequiredDependencyException(msg)
__main__.RequiredDependencyException:
The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
How can I install Pillow?
The pre-compiled versions of Pillow are available here, but not all versions are included.
As long as you make sure to use a version that has a precompiled binary (either as direct install or in a pip/peotry/etc dependency list), things will work.
Try installing Pillow like below (If you are using Python3):
pip3 install pillow
And this: (If you are using Python2):
pip install pillow
Pillow needs to be compiled on Windows. pip install Pillow tries to use a precompiled version and if it fails - it tries to compile it locally.
You're using Python 3.7 which hasn't been released yet, I suspect the Pillow people have not prepared a precompiled binary for this.
Easiest solution would be to downgrade to Python 3.6. Otherwise, you'll need to install everything necessary to compile Pillow.
For latest Anaconda with python3.7, pillow is available. Install it by using:
conda install pillow
After that, deactivate your current env, and activate env again, then it should work. (This step is important to make it effective)
Maybe someone will be useful.
Only after I updated some packages to certain versions, I was able to install package Pillow (7.0.0) on virtual env.
I updated package setuptools to the latest version (on that moment, 44.0.0)
And updated package pip to 19.2.3.
for reference, I used:
Python 3.8.0,
Django 2.2.8,
Virtualenv 16.7.9,
Windows 10 SL x64
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.
Having issues installing some python modules (for example pandas) and also had some issues installing ipython notebook.
This error seems to have come up before for other folks (Python pip install fails: invalid command egg_info), but they were using Python 2.7, whereas I'm using 2.6 (default with my Mac OS 10.6). Also I tried easy_install -U setuptools and pip install --upgrade setuptools but neither worked.
This is the error I get for installing pandas:
Command python setup.py egg_info failed with error code 1 in /private/var/folders/Wm/WmmbYincEnuCrAMtGBudAk+++TM/-Tmp-/pip_build_AWal/pandas
Storing debug log for failure in /Users/AWal/Library/Logs/pip.log
For installing iPython, this is the error that I get:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/req.py", line 671, in install
self.move_wheel_files(self.source_dir, root=root)
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/req.py", line 901, in move_wheel_files
pycompile=self.pycompile,
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/wheel.py", line 341, in move_wheel_files
generated.extend(maker.make_multiple(['%s = %s' % kv for kv in console.items()]))
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/_vendor/distlib/scripts.py", line 316, in make_multiple
filenames.extend(self.make(specification, options))
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/_vendor/distlib/scripts.py", line 305, in make
self._make_script(entry, filenames, options=options)
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/_vendor/distlib/scripts.py", line 209, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/_vendor/distlib/scripts.py", line 189, in _write_script
self._fileop.write_binary_file(outname, script_bytes)
File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/_vendor/distlib/util.py", line 384, in write_binary_file
with open(path, 'wb') as f:
IOError: [Errno 13] Permission denied: '/usr/local/bin/sphinx-apidoc'
Storing debug log for failure in /Users/AWal/Library/Logs/pip.log
Any thoughts on what to do?
UPDATE:
When I do sudo pip install pandas (another module that I can't install), I get a long long traceback with the end error message:
RuntimeError: Broken toolchain: cannot link a simple C program
And traceback (a sample of it of the 100 or so lines) looks like this:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/private/tmp/pip_build_root/pandas/setup.py", line 619, in <module>
**setuptools_kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 113, in setup
File "build/bdist.macosx-10.6-universal/egg/setuptools/dist.py", line 266, in __init__
File "build/bdist.macosx-10.6-universal/egg/setuptools/dist.py", line 312, in fetch_build_eggs
File "build/bdist.macosx-10.6-universal/egg/pkg_resources/__init__.py", line 753, in resolve
File "build/bdist.macosx-10.6-universal/egg/pkg_resources/__init__.py", line 1005, in best_match
File "build/bdist.macosx-10.6-universal/egg/pkg_resources/__init__.py", line 1017, in obtain
File "build/bdist.macosx-10.6-universal/egg/setuptools/dist.py", line 379, in fetch_build_egg
File "build/bdist.macosx-10.6-universal/egg/setuptools/command/easy_install.py", line 619, in easy_install
A permission Denied message would suggest you to run your command as root as suggested by Hackaholic.
try sudo pip install YOUR_PACKAGE
You might also want to have a look at virtualenv to use a more isolated environment.
Under debian based distributions, you might install python-virtualenv package with apt-get install python-virtualenv.
Then create a virtual environment names whatever by typing virtualenv whatever (this will create a folder whatever inside your current folder.
Then cd to it and type bin/activate to enter this virtual environment.
From there try again your pip install command.
Might help
UPDATE :
You might try to use the suggested solutions available here
To sumup, try to add export ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future inside ~/.bash_profile
This question comes first in Google, but the second one actually worked:
pip install -U setuptools
pip install ez_setup
I have a bit of a problem. I am on Debian Squeeze, and I want to install sqlite2. The problem is, when I try with:
# pip install pysqlite2
I get:
Downloading/unpacking pysqlite2
Could not find any downloads that satisfy the requirement pysqlite2
No distributions at all found for pysqlite2
Storing complete log in /root/.pip/pip.log
The same error I get when I try with:
# pip install python-pysqlite2
I also tried with easy_install:
# easy_install pysqlite2
Searching for pysqlite2
Reading http://pypi.python.org/simple/pysqlite2/
Couldn't find index page for 'pysqlite2' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for pysqlite2
Best match: None
Traceback (most recent call last):
File "/usr/local/bin/easy_install", line 8, in <module>
load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
File "/usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1712, in main
File "/usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
File "/usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1716, in <lambda>
File "/usr/local/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 211, in run
File "/usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 434, in easy_install
File "/usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/package_index.py", line 475, in fetch_distribution
AttributeError: 'NoneType' object has no attribute 'clone'
I also tried with downloading the pyslite2 package from here, and when I try with:
# dpkg -i python-pysqlite2-dbg_2.6.0-1_amd64.deb
I get the following error:
Selecting previously deselected package python-pysqlite2-dbg.
(Reading database ... 144103 files and directories currently installed.)
Unpacking python-pysqlite2-dbg (from python-pysqlite2-dbg_2.6.0-1_amd64.deb) ...
dpkg: dependency problems prevent configuration of python-pysqlite2-dbg:
python-pysqlite2-dbg depends on python-pysqlite2 (= 2.6.0-1); however:
Package python-pysqlite2 is not configured yet.
python-pysqlite2-dbg depends on python-dbg; however:
Package python-dbg is not installed.
dpkg: error processing python-pysqlite2-dbg (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
python-pysqlite2-dbg
I would really appriciate help for this.
Thanks in advance!
Just run apt-get install to install all missing dependencies:
apt-get -f install
I am trying to install distribute using ActivePython 3.1.2 on Windows.
Running python distribute_setup.py as described on the cheese shop give me:
No setuptools distribution found
running install
Traceback (most recent call last):
File "setup.py", line 177, in
scripts = scripts,
File "C:\Dev\Python_x86\3.1\lib\distutils\core.py", line 149, in setup
dist.run_commands()
File "C:\Dev\Python_x86\3.1\lib\distutils\dist.py", line 919, in run_commands
self.run_command(cmd)
File "C:\Dev\Python_x86\3.1\lib\distutils\dist.py", line 938, in run_command
cmd_obj.run()
File "build\src\setuptools\command\install.py", line 73, in run
self.do_egg_install()
File "build\src\setuptools\command\install.py", line 82, in do_egg_install
easy_install = self.distribution.get_command_class('easy_install')
File "build\src\setuptools\dist.py", line 361, in get_command_class
self.cmdclass[command] = cmdclass = ep.load()
File "build\src\pkg_resources.py", line 1953, in load
entry = import(self.module_name, globals(),globals(), ['name'])
File "build\src\setuptools\command\easy_install.py", line 16, in
from setuptools.sandbox import run_setup
File "build\src\setuptools\sandbox.py", line 164, in
fromlist=['name']).file)
AttributeError: 'module' object has no attribute 'file'
Something went wrong during the installation.
See the error message above.
Is there possibly an unknown dependency that I'm missing?
Downloading the source tarball and executing python setup.py install produces the exact same output.
Edit: Added the full stack trace for running the installer.
So apparently the python.org version of Python3 is different from the ActiveState version of Python3. (You should file a bug to someone (I'm not sure to whom))
The fix I have (I'm not sure of all the repercussions)
Download:
http://pypi.python.org/packages/source/d/distribute/distribute-0.6.12.tar.gz#md5=5a52e961f8d8799d243fe8220f9d760e
and then extracting it and modify:
distribute-0.6.12\setuptools\sandbox.py:165
from:
except ImportError:
to
except (ImportError, AttributeError):
that will silence the error and allow you to run:
python setup.py install
It took me awhile to find a package from http://pypi.python.org/pypi?:action=browse&c=533&show=all that would actually install on either version of Python3. "files" was the first package, and since it installed I am pretty sure that easy_install is working for both copies of Python3.
...hope it works! (That's all I can help you with)
this is a bug with Distribute http://bitbucket.org/tarek/distribute/issue/151 ... it should be fixed by next release (0.6.13). It is only reproducible with PyWin32 installed; and ActivePython comes bundled with PyWin32.