I have been trying to install Django correctly for a while to no avail.
C:\Python34\Scripts\pip.exe install C:\Python34\Lib\site-packages\Django-1.7.2\Django-1.7.2\setup.py
raises an exception and stores the following in a log file:
C:\Python34\Scripts\pip run on 01/12/15 17:47:02
Exception:
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "C:\Python34\lib\site-packages\pip\commands\install.py", line 257, in run
InstallRequirement.from_line(name, None))
File "C:\Python34\lib\site-packages\pip\req.py", line 172, in from_line
return cls(req, comes_from, url=url, prereleases=prereleases)
File "C:\Python34\lib\site-packages\pip\req.py", line 70, in __init__
req = pkg_resources.Requirement.parse(req)
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2606, in parse
reqs = list(parse_requirements(s))
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2544, in parse_requirements
line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2512, in scan_list
raise ValueError("Expected "+item_name+" in",line,"at",line[p:])
ValueError: ('Expected version spec in', 'C:\\Python34\\Lib\\site-packages\\Django-1.7.2\\Django-1.7.2\\setup.py', 'at', ':\\Python34\\Lib\\site-packages\\Django-1.7.2\\Django-1.7.2\\setup.py')
any help would be greatly appreciated!
THANK YOU
For pip install refer to the directory containing setup.py.
C:\Python34\Scripts\pip.exe install C:\Python34\Lib\site-packages\Django-1.7.2\Django-1.7.2\
But since your path has site-packages in it already (e.g. C:\Python34\Lib\site-packages\) it would seem that it is already installed.
Other alternatives are:
pip install django==1.7.2
pip install django==1.7
python C:...\Django-1.7.2\setup.py install
Related
Whats I'll do ?
odoo#odoo-Aspire-ES1-572:~$ pip2 install pyboleto
Collecting pyboleto
Using cached pyboleto-0.3.1.tar.gz
Collecting distribute (from pyboleto)
Using cached distribute-0.7.3.zip
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/distribute.egg-info
writing requirements to pip-egg-info/distribute.egg-info/requires.txt
writing pip-egg-info/distribute.egg-info/PKG-INFO
writing top-level names to pip-egg-info/distribute.egg-info/top_level.txt
writing dependency_links to pip-egg-info/distribute.egg-info/dependency_links.txt
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-wdypyY/distribute/setup.py", line 58, in <module>
setuptools.setup(**setup_params)
File "/home/odoo/.pyenv/versions/2.7.12/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/home/odoo/.pyenv/versions/2.7.12/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/home/odoo/.pyenv/versions/2.7.12/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "setuptools/command/egg_info.py", line 177, in run
writer = ep.load(installer=installer)
File "pkg_resources.py", line 2241, in load
if require: self.require(env, installer)
File "pkg_resources.py", line 2254, in require
working_set.resolve(self.dist.requires(self.extras),env,installer)))
File "pkg_resources.py", line 2471, in requires
dm = self._dep_map
File "pkg_resources.py", line 2682, in _dep_map
self.__dep_map = self._compute_dependencies()
File "pkg_resources.py", line 2699, in _compute_dependencies
from _markerlib import compile as compile_marker
ImportError: No module named _markerlib
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-wdypyY/distribute/
odoo#odoo-Aspire-ES1-572:~$ pip2 install _markerlib
Invalid requirement: '_markerlib'
Traceback (most recent call last):
File "/home/odoo/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 82, in __init__
req = Requirement(req)
File "/home/odoo/.local/lib/python2.7/site-packages/pip/_vendor/packaging/requirements.py", line 96, in __init__
requirement_string[e.loc:e.loc + 8]))
InvalidRequirement: Invalid requirement, parse error at "'_markerl'"
Please try the following:
sudo apt-get update # Fetches the list of available updates
sudo apt-get upgrade # Strictly upgrades the current packages
sudo apt-get dist-upgrade # Installs updates (new ones)
sudo pip install pyboleto
I've been trying to install this Python wrapper for the past two days. I went through all the other questions here on Stack Overflow. Tried literally everything, and nothing seems to work.
Processing /../../../../../wrappers/Python
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-twPZdY-build/setup.py", line 50, in <module>
**cffi_args
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 319, in __init__
_Distribution.__init__(self, attrs)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 386, in finalize_options
ep.load()(self, ep.name, value)
File "/private/tmp/pip-twPZdY-build/.eggs/cffi-1.10.0-py2.7-macosx-10.11-x86_64.egg/cffi/setuptools_ext.py", line 188, in cffi_modules
add_cffi_module(dist, cffi_module)
File "/private/tmp/pip-twPZdY-build/.eggs/cffi-1.10.0-py2.7-macosx-10.11-x86_64.egg/cffi/setuptools_ext.py", line 49, in add_cffi_module
execfile(build_file_name, mod_vars)
File "/private/tmp/pip-twPZdY-build/.eggs/cffi-1.10.0-py2.7-macosx-10.11-x86_64.egg/cffi/setuptools_ext.py", line 25, in execfile
exec(code, glob, glob)
File "../ffi_build.py", line 34, in <module>
ffi.set_source('../_ffi', None)
File "/private/tmp/pip-twPZdY-build/.eggs/cffi-1.10.0-py2.7-macosx-10.11-x86_64.egg/cffi/api.py", line 612, in set_source
raise ValueError("'module_name' must not contain '/': use a dotted "
ValueError: 'module_name' must not contain '/': use a dotted name to make a 'package.module' location
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-twPZdY-build/
I've reinstalled everything at least twice, updated, tried sudo -H, but nothing seems to work. It seems like a problem with setuptools, but I have no idea how to fix it.
Mac OSX 10.11.6 (El Capitan)
Python 2.7.13
Pip 9.0.1
After carefully reading through the error message, I managed to find the file called ffi_build.py under the Python folder I was trying to bind. As stated in the error message, at line 34 there was a module naming statement that contained a '/'. By replacing that '/' with a '.' I solved the issue and managed to bind the Python wrapper with no issue whatsoever.
I was trying to install Django1.10 on my ubuntu 16.04 using pip install Django==1.10. Now I'm facing an error which I think is related to directories of installation path but I don't know how to get through. Here is the error:
Exception:
Traceback (most recent call last):
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 742, in install
**kwargs
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/wheel.py", line 346, in move_wheel_files
clobber(source, lib_dir, True)
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/wheel.py", line 317, in clobber
ensure_dir(destdir)
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/utils/init.py", line 83, in ensure_dir
os.makedirs(path)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/Django-1.10.dist-info'
Can anybody tell me what I should do to fix it? Thanks in advance.
You may need super user privilege to install a package globally. So append sudo before your command.
sudo pip install Django==1.10
Running pip as sudo is not the best of choices. That is like giving superuser access to an external application. Rather try this first:
pip install --user django==1.11
From the official networkx Version 1.9 notes and API changes:
Basic support is added for Jython 2.7 [...], although they remain not officially supported.
How can I install networkx on Jython?
What I have tried:
Installed jython2.7.0 on my Ubuntu 14.04 32bit.
Tried installing networkx via pip:
sudo /opt/jython2.7.0/bin/pip install networkx
which downloaded the file networkx-1.9.1-py2.py3-none-any.whl, but then errored at some point:
Exception:
Traceback (most recent call last):
File "/opt/jython2.7.0/Lib/site-packages/pip/basecommand.py", line 133, in main
status = self.run(options, args)
File "/opt/jython2.7.0/Lib/site-packages/pip/commands/install.py", line 325, in run
requirement_set.install(
File "/opt/jython2.7.0/Lib/site-packages/pip/commands/install.py", line 325, in run
requirement_set.install(
File "/opt/jython2.7.0/Lib/site-packages/pip/req/req_set.py", line 633, in install
requirement.install(
File "/opt/jython2.7.0/Lib/site-packages/pip/req/req_install.py", line 719, in install
self.move_wheel_files(self.source_dir, root=root)
File "/opt/jython2.7.0/Lib/site-packages/pip/req/req_install.py", line 990, in move_wheel_files
move_wheel_files(
File "/opt/jython2.7.0/Lib/site-packages/pip/wheel.py", line 154, in move_wheel_files
compileall.compile_dir(source, force=True, quiet=True)
File "/opt/jython2.7.0/Lib/compileall.py", line 56, in compile_dir
if not compile_dir(fullname, maxlevels - 1, dfile, force, rx,
File "/opt/jython2.7.0/Lib/compileall.py", line 56, in compile_dir
if not compile_dir(fullname, maxlevels - 1, dfile, force, rx,
File "/opt/jython2.7.0/Lib/compileall.py", line 50, in compile_dir
if not compile_file(fullname, ddir, force, rx, quiet):
File "/opt/jython2.7.0/Lib/compileall.py", line 99, in compile_file
ok = py_compile.compile(fullname, None, dfile, True)
File "/opt/jython2.7.0/Lib/compileall.py", line 99, in compile_file
ok = py_compile.compile(fullname, None, dfile, True)
File "/opt/jython2.7.0/Lib/py_compile.py", line 99, in compile
_py_compile.compile(file, cfile, dfile)
File "/opt/jython2.7.0/Lib/py_compile.py", line 99, in compile
_py_compile.compile(file, cfile, dfile)
RuntimeException: java.lang.RuntimeException: Method code too large!
I added the following print statements before the _py_compile.compile(file, cfile, dfile) functions:
print "file: %s" % file
print "cfile: %s" % cfile
print "dfile: %s" % dfile
which gave me:
file: /tmp/pip_build_vagrant/networkx/networkx/generators/atlas.py
cfile: None
dfile: None
Did anybody manage to install networkx 1.9 on Jython2.7.0?
Here's how to get networkx installed in Jython:
Go to PyPI and download the networkx source package.
extract the networkx source into a folder.
in the source folder, delete the file networkx/generators/atlas.py (this is the file that's too large for Jython to parse. It doesn't work in Jython anyways, so just delete it).
in the file networkx/readwrite/gml.py, remove all mentions of lib2to3 (due to a current bug in Jython, lib2to3 is not available):
on lines 44-46, comment out imports from lib2to3
on lines around 75, change:
rtp_fix_unicode = RefactoringTool(['lib2to3.fixes.fix_unicode'],
{'print_function': True})
to:
rtp_fix_unicode = None
around line 145, in the try-except statement, remove ParseError and TokenError.
go back to the source folder, and run:
jython/pip install .
Or alternatively, if you don't have pip for jython:
jython setup.py install
It should install successfully, and you should be able to import networkx in Jython now.
I am trying to install app on heroku. After doing git push heroku master, I am getting following error.
-----> Installing dependencies using Pip (1.5.4)
Exception:
Traceback (most recent call last):
File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg
/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg /pip/commands/install.py", line 262, in run
for req in parse_requirements(filename, finder=finder, options=options, session=session):
File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 1631, in parse_requirements
req = InstallRequirement.from_line(line, comes_from, prereleases=getattr(options, "pre", None))
File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 172, in from_line
return cls(req, comes_from, url=url, prereleases=prereleases)
File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 70, in __init__
req = pkg_resources.Requirement.parse(req)
File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/_vendor/pkg_resources.py", line 2606, in parse
reqs = list(parse_requirements(s))
File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/_vendor/pkg_resources.py", line 2544, in parse_requirements
line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")
File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/_vendor/pkg_resources.py", line 2512, in scan_list
raise ValueError("Expected "+item_name+" in",line,"at",line[p:])
ValueError: ('Expected version spec in', 'Usage:', 'at', ':')
Storing debug log for failure in /app/.pip/pip.log
I am not sure what is missing. I am adding my requirements.txt which looks like.
Babel==1.3
Flask==0.9
Flask-Babel==0.8
Flask-Login==0.2.10
Flask-Mail==0.7.6
Flask-OpenID==1.2.1
Flask-SQLAlchemy==0.16
Flask-WTF==0.8.4
Flask-WhooshAlchemy==0.55a
Jinja2==2.7.2
MarkupSafe==0.19
SQLAlchemy==0.7.9
Tempita==0.5.2
WTForms==1.0.5
Werkzeug==0.9.4
Whoosh==2.6.0
argparse==1.2.1
blinker==1.3
decorator==3.4.0
flup==1.0.2
gunicorn==18.0
python-openid==2.2.5
pytz==2013b
speaklater==1.3
sqlalchemy-migrate==0.7.2
wsgiref==0.1.2
Not sure if its version issue.