Dependency error while installing app on heroku - python-2.7

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.

Related

Issue while installing pip on RHEL6 server with no internet

We have python 2.7 installed on server
Tried installing pip by following steps
1) downloaded pip-19.1.1 tar file from internet on local machine(ubuntu)
2) transfered file to server and extracted the content
2) ran setup.py file present in the folder using comman python setup.py
but giving below error
Traceback (most recent call last):
File "/usr/bin/Python-2.7.12/Lib/site.py", line 548, in <module>
main()
File "/usr/bin/Python-2.7.12/Lib/site.py", line 530, in main
known_paths = addusersitepackages(known_paths)
File "/usr/bin/Python-2.7.12/Lib/site.py", line 266, in addusersitepackages
user_site = getusersitepackages()
File "/usr/bin/Python-2.7.12/Lib/site.py", line 241, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/bin/Python-2.7.12/Lib/site.py", line 231, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/bin/Python-2.7.12/Lib/sysconfig.py", line 520, in get_config_var
return get_config_vars().get(name)
File "/usr/bin/Python-2.7.12/Lib/sysconfig.py", line 472, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/bin/Python-2.7.12/Lib/sysconfig.py", line 356, in _init_posix
from _sysconfigdata import build_time_vars
ImportError: No module named _sysconfigdata\
Also downloaded get-pip.py file from link https://bootstrap.pypa.io/get-pip.py. Executed python get-pip.py on server but giving the above same error.

eb cli error message Traceback (most recent call last):

I tried to install eb cli throw pip or msi and i always get the same wierd message after i check if eb was installed successfully:
PS C:\Users\liron> eb --version
Traceback (most recent call last):
File "C:\Users\liron\AppData\Roaming\Python\Python36\site-packages\pkg_resources__init__.py", line 570, in _build_master
ws.require(requires)
File "C:\Users\liron\AppData\Roaming\Python\Python36\site-packages\pkg_resources__init__.py", line 888, in require
needed = self.resolve(parse_requirements(requirements))
File "C:\Users\liron\AppData\Roaming\Python\Python36\site-packages\pkg_resources__init__.py", line 779, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (colorama 0.3.9 (c:\users\liron\appdata\roaming\python\python36\site-packages), Requirement.parse('colorama==0.3.7'), {'awsebcli'})
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\liron\AppData\Roaming\Python\Scripts\eb-script.py", line 6, in
from pkg_resources import load_entry_point
File "C:\Users\liron\AppData\Roaming\Python\Python36\site-packages\pkg_resources__init__.py", line 3095, in
#_call_aside
File "C:\Users\liron\AppData\Roaming\Python\Python36\site-packages\pkg_resources__init__.py", line 3079, in _call_aside
f(*args, **kwargs)
File "C:\Users\liron\AppData\Roaming\Python\Python36\site-packages\pkg_resources__init__.py", line 3108, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "C:\Users\liron\AppData\Roaming\Python\Python36\site-packages\pkg_resources__init__.py", line 572, in _build_master
return cls._build_from_requirements(requires)
File "C:\Users\liron\AppData\Roaming\Python\Python36\site-packages\pkg_resources__init__.py", line 585, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "C:\Users\liron\AppData\Roaming\Python\Python36\site-packages\pkg_resources__init__.py", line 779, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (colorama 0.3.7 (c:\users\liron\appdata\roaming\python\lib\site-packages), Requirement.parse('colorama<0.4,>=0.3.9; sys_platform == "win32"'), {'docker-compose'})
i tried to install with pip and msi.
aws version: aws-cli/1.15.35 Python/3.6.0 Windows/7 botocore/1.10.35
python version: Python 3.6.3
pip version: pip 10.0.1 from c:\users\liron\appdata\roaming\python\lib\site-packages\pip (python 3.6).
i tried to update and uninstall everything without any luck.
thank you for your help :)

cannot install packages through pip

Python: 2.7.12
Pip: 8.1.1
When I sudo pip install pandas, it shows as follows:
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 317, in run
requirement_set.prepare_files(finder)
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 360, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 512, in _prepare_file
finder, self.upgrade, require_hashes)
File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 273, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 442, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 400, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 545, in _get_pages
page = self._get_page(location)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 648, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 757, in get_page
"Cache-Control": "max-age=600",
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 480, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 378, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 468, in request
resp = self.send(prep, **send_kwargs)
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/adapter.py", line 46, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/adapters.py", line 376, in send
timeout=timeout
File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 610, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 228, in increment
total -= 1
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
download .whl file for pandas
try
pip install pandas.whl
or upgrade or pip and repeat the command
pip install pandas
I think there is some problem with pip command. So you can install Anaconda for python 2.7 (Download). It comes with pip by default.
Once download will be completed (it is script file).
Give the permission to the script file.
sudo chmod 777 Anaconda2-5.1.0-Linux-x86_64.sh
Run the script file on terminal../Anaconda2-5.1.0-Linux-x86_64.sh or bash Anaconda2-5.1.0-Linux-x86_64.sh
Follow the instruction from point 4th to this document here

Virtualenv throws an error when I try virtualenv -p python3

All of a sudden When I try to add python3 to virtualenv like this
virtualenv -p python3 env
I get the following error
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 726, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 746, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 303, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/virtualenv-13.1.2.dist-info/DESCRIPTION.rst'
This just started happening out of nowhere a few hours ago because I have been using it tonite. Can anyone tell me what's going on with this? thanks

Trying to install Django

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