Installing pyreadline on portable python - python

I recently got portable python 2.7.6.1 from here
I need to install pyreadline to this
I downloaded pyreadline zip file from https://pypi.org/project/pyreadline/#files
Is this zip file enough to get pyreadline installed in potable python? I don't have prior experience with python but I have read other posts about people trying to install modules to portable python so I am guessing it should be possible
I tried installing pip using easy_setup pip on the command prompt but I get the following error:
Searching for pip
Reading http://pypi.python.org/simple/pip/
Couldn't find index page for 'pip' (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 pip
Best match: None
Traceback (most recent call last):
File "D:\data_aba\python files\python_portable_2761\App\Scripts\easy_install-script.py", line 8, in <module>
load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
File "D:\data_aba\python files\python_portable_2761\App\lib\site-packages\setuptools\command\easy_install.py", line 1712, in main
with_ei_usage(lambda:
File "D:\data_aba\python files\python_portable_2761\App\lib\site-packages\setuptools\command\easy_install.py", line 1700, in with_ei_usage
return f()
File "D:\data_aba\python files\python_portable_2761\App\lib\site-packages\setuptools\command\easy_install.py", line 1716, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
File "D:\data_aba\python files\python_portable_2761\App\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "D:\data_aba\python files\python_portable_2761\App\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "D:\data_aba\python files\python_portable_2761\App\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "D:\data_aba\python files\python_portable_2761\App\lib\site-packages\setuptools\command\easy_install.py", line 211, in run
self.easy_install(spec, not self.no_deps)
File "D:\data_aba\python files\python_portable_2761\App\lib\site-packages\setuptools\command\easy_install.py", line 434, in easy_install
self.local_index
File "D:\data_aba\python files\python_portable_2761\App\lib\site-packages\setuptools\package_index.py", line 475, in fetch_distribution
return dist.clone(location=self.download(dist.location, tmpdir))
AttributeError: 'NoneType' object has no attribute 'clone'
Is there any way to install pyreadline from the contents of the zip file, or at least get pip installed so that I can use it to search for pyreadline?
EDIT 1 ---
I went to https://pypi.org/simple/pip/ and downloaded pip-18.0.tar.gz. Is there any way I can install this manually from this zip file? But then again if that was possible, I assume it should be possible to just install pyreadline directly? How can I do this manunaly?

Related

Using pipenv and briefcase, getting AttributeError for pip module

I'm attempting to briefcase a hello-world type script, from a virtual environment created using pipenv. My original python installation building using Anaconda, though I don't really need it as I don't use any of the scientific computing stack. I am not sure what I'm experiencing is a pipenv error, a pip error, or a briefcase error. If you could help me sort this, I would really appreciate it.
Briefcase
(root) C:\Users\stmwr\Dropbox\SoftwareProjects\helloworld-br\helloworld>python setup.py windows
running windows
Traceback (most recent call last):
File "setup.py", line 73, in <module>
'app_requires': [
File "C:\Users\stmwr\Anaconda3\lib\site-packages\setuptools\__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "C:\Users\stmwr\Anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\stmwr\Anaconda3\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Users\stmwr\Anaconda3\lib\distutils\dist.py", line 973, in run_command
cmd_obj.ensure_finalized()
File "C:\Users\stmwr\Anaconda3\lib\distutils\cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "C:\Users\stmwr\Anaconda3\lib\site-packages\briefcase\windows.py", line 18, in finalize_options
finalized = self.get_finalized_command('app')
File "C:\Users\stmwr\Anaconda3\lib\distutils\cmd.py", line 299, in get_finalized_command
cmd_obj.ensure_finalized()
File "C:\Users\stmwr\Anaconda3\lib\distutils\cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "C:\Users\stmwr\Anaconda3\lib\site-packages\briefcase\app.py", line 123, in finalize_options
pip.utils.ensure_dir(self.download_dir)
AttributeError: module 'pip' has no attribute 'utils'
It's likely that this is an issue with Pipenv not supporting Pip 10 yet; in Pip 10, all internal APIs were moved around, which broke all applications that depended on them. I believe the aim is to have a release out soon.
If you can wait a couple of days and then update Pipenv, that will probably be easiest. If you can't wait, you could try to downgrade Pip to version 9.0.3, which should work again.

ImportError: No module named _markerlib when trying to install via pip

Did somebody experienced the same problem? I tried to run a solution from SO:
pip install --upgrade distribute
and
pip install --upgrade setuptools
And I got the same result, every time:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-JC9mq_/distribute/setup.py", line 58, in <module>
setuptools.setup(**setup_params)
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/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
python 2.7, pip 8.1.2
[EDIT]
The solution of creating a new env. with virtualenv myenv --distribute worked for the local environment, but when I try to push to the heroku, it gives me exactly the same error: No module named _markerlib. So, the problem is not just in the local env.
I fixed it this way, I think.
pip uninstall setuptools
download https://bitbucket.org/pypa/setuptools/raw/0.7.3/ez_setup.py
Run that,then
pip install %HOME%\Downloads\wheel-0.25.0.tar.gz
pip install Distribute
I did this so this would work
pip install django-validated-file

Pycharm issues with installing Setuptools

I have recently played around with different versions of Python 2.7 and I ended up breaking PyCharm.
Firstly I have uninstalled and reinstalled Python and Pycharm multiple times with no luck.
I get the feeling that setup tools is the main issue but I can't seem to get it uninstalled correctly...
Below is the error Pycharm is giving and I am seeing similar errors trying to fix setuptools manually.
Anybody have a clue what is wrong with my environment?
Install package failed.
The following command was executed:
c:\users\ask\appdata\local\temp\tmpf3zyjdpycharm-management\setuptools-1.1.5\setup.py install
The error output of the command:
Traceback (most recent call last):
File "c:\users\ask\appdata\local\temp\tmpf3zyjdpycharm-management\setuptools-1.1.5\setup.py", line 204, in <module>
dist = setuptools.setup(**setup_params)
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:\users\ask\appdata\local\temp\tmpf3zyjdpycharm-management\setuptools-1.1.5\setuptools\command\install.py", line 73, in run
self.do_egg_install()
File "c:\users\ask\appdata\local\temp\tmpf3zyjdpycharm-management\setuptools-1.1.5\setuptools\command\install.py", line 82, in do_egg_install
easy_install = self.distribution.get_command_class('easy_install')
File "c:\users\ask\appdata\local\temp\tmpf3zyjdpycharm-management\setuptools-1.1.5\setuptools\dist.py", line 363, in get_command_class
self.cmdclass[command] = cmdclass = ep.load()
File "c:\users\ask\appdata\local\temp\tmpf3zyjdpycharm-management\setuptools-1.1.5\pkg_resources.py", line 2108, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "c:\users\ask\appdata\local\temp\tmpf3zyjdpycharm-management\setuptools-1.1.5\setuptools\command\easy_install.py", line 34, in <module>
from setuptools.sandbox import run_setup
File "c:\users\ask\appdata\local\temp\tmpf3zyjdpycharm-management\setuptools-1.1.5\setuptools\sandbox.py", line 209, in <module>
_EXCEPTIONS.append(GetGeneratePath())
File "win32com\client\gencache.pyc", line 131, in GetGeneratePath
AssertionError: Why do you want the genpath for a readonly store?
I finally managed to get this resolved. I installed a library called Automa about the same time I started getting the issue. With the install I had to add a PYTHONPATH entry and when I removed it today setup tools was able to install again.
I have added the PYTHONPATH back again and I am still able to install libraries with setupTools/Pip. So it must have not liked the path while installing.
I very happy to be back on track again!!!! :)

TypeError: dist must be a Distribution instance

My package depends on BeautifulSoup. If I install my package in a fresh virtualenv via python setup.py develop, I get the following error. If I execute python setup.py develop a second time, everything seems to work fine. I have no idea, what's happening. How to fix it to get a reproducable setup?
Best match: beautifulsoup4 4.3.2
Downloading https://pypi.python.org/packages/source/b/beautifulsoup4/beautifulsoup4-4.3.2.tar.gz#md5=b8d157a204d56512a4cc196e53e7d8ee
Processing beautifulsoup4-4.3.2.tar.gz
Writing /tmp/easy_install-1eBfi3/beautifulsoup4-4.3.2/setup.cfg
Running beautifulsoup4-4.3.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-1eBfi3/beautifulsoup4-4.3.2/egg-dist-tmp-YmoFSq
Traceback (most recent call last):
File "setup.py", line 73, in <module>
""",
File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/command/develop.py", line 27, in run
self.install_for_development()
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/command/develop.py", line 129, in install_for_development
self.process_distribution(None, self.dist, not self.no_deps)
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 671, in process_distribution
[requirement], self.local_index, self.easy_install
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/pkg_resources.py", line 564, in resolve
dist = best[req.key] = env.best_match(req, self, installer)
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/pkg_resources.py", line 802, in best_match
return self.obtain(req, installer) # try and download/install
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/pkg_resources.py", line 814, in obtain
return installer(requirement)
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 593, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 623, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 809, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1015, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1000, in run_setup
run_setup(setup_script, args)
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 50, in run_setup
lambda: execfile(
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 100, in run
return func()
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 52, in <lambda>
{'__file__':setup_script, '__name__':'__main__'}
File "setup.py", line 27, in <module>
'raven',
File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 970, in run_command
cmd_obj = self.get_command_obj(command)
File "/usr/lib/python2.7/distutils/dist.py", line 846, in get_command_obj
cmd_obj = self.command_obj[command] = klass(self)
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/__init__.py", line 69, in __init__
_Command.__init__(self,dist)
File "/usr/lib/python2.7/distutils/cmd.py", line 59, in __init__
raise TypeError, "dist must be a Distribution instance"
TypeError: dist must be a Distribution instance
This error has to do with a discrepancy between the versions of distutils and setuptools installed on your machine. Upgrading setuptools to the current version is likely to resolve the issue.
EDIT: This solution no longer works for me (and apparently never worked for Jens -- see comment below). What now works for me is to import setuptools before anything else in whatever script I'm calling that leads to this error.
This error is discussed in many issues on GitHub, in many packages, but I find this discussion to be the most informative.
The only way I was able to solve it was to follow the https://bugs.python.org/file37554/distutils_accomodate_distribution_ducktypes.patch
So - I removed /usr/lib/python2.7/distutils/cmd.py and /usr/lib/python2.7/distutils/cmd.pyc ( ran a python setup.py develop - just to make sure it fails and is not using the pyc from somewhere else ) and then recreated /usr/lib/python2.7/distutils/cmd.py - only this time with the changes as shown in the patch. Then when I used python setup.py again - it worked..
install dnspython. pip install dnspython. Or check if u have older version of dnspython and upgrade
Try using pip for installing your package
$ pip install -e path/to/your/Project
See http://pip.readthedocs.org/en/latest/reference/pip_install.html#editable-installs for more information.
When I encountered this, it appeared at first glance that it was complaining that Distribution() didn't produce a Distribution instance, but that was only partly true.
setuptools provides its own Distribution, and monkeypatches it into distutils. That works in most cases, but will fail if you get a reference to Distribution before setuptools has been imported and done its magic.
The top of the script read:
from distutils.dist import Distribution
and then later we were importing and using various parts of setuptools.
The solution in my case was to do a late import in the function that uses it so Distribution was obtained after setuptools was loaded.

easy_install libmysqld-dev error :'NoneType' object has no attribute 'clone'

this is the error :
(mysite)zjm1126#zjm1126-G41MT-S2:~/zjm_test/mysite$ ./bin/easy_install libmysqld-dev
Searching for libmysqld-dev
Reading http://pypi.python.org/simple/libmysqld-dev/
Couldn't find index page for 'libmysqld-dev' (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 libmysqld-dev
Best match: None
Traceback (most recent call last):
File "./bin/easy_install", line 8, in <module>
load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
File "/home/zjm1126/zjm_test/mysite/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py", line 1712, in main
File "/home/zjm1126/zjm_test/mysite/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
File "/home/zjm1126/zjm_test/mysite/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py", line 1716, in <lambda>
File "/usr/lib/python2.6/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "/home/zjm1126/zjm_test/mysite/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py", line 211, in run
File "/home/zjm1126/zjm_test/mysite/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py", line 434, in easy_install
File "/home/zjm1126/zjm_test/mysite/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/package_index.py", line 475, in fetch_distribution
AttributeError: 'NoneType' object has no attribute 'clone'
what can i do,
thanks
Try to update setuptools:
easy_install -U setuptools
This error indicates that easy-install cannot locate the package, meaning that it is not found.
You'd be better off installing the dev package via your distribution's package manager (apt-get etc)
If you examine the output carefully, notice:
Reading http://pypi.python.org/simple/
No local packages or download links found for libmysqld-dev
Best match: None

Categories