Due to firewall blocked the pip installer , I have to download the tar file and use setup tool to install package as below :
python setup.py install
My python version is py 2.75 so I choosed the pylint 1.9.3 according to instruction.
But it turns out below error message :
Couldn't find index page for 'pytest-runner' (maybe misspelled?) No
local packages or download links found for pytest-runner Traceback
(most recent call last): File "setup.py", line 181, in
install() File "setup.py", line 178, in install
**kwargs) File "C:\Program Files (x86)\Python27\lib\distutils\core.py", line 112, in setup
_setup_distribution = dist = klass(attrs) File "C:\Program Files (x86)\Python27\lib\site-packages\setuptools\dist.py", line 260, in
init
self.fetch_build_eggs(attrs.pop('setup_requires')) File "C:\Program Files
(x86)\Python27\lib\site-packages\setuptools\dist.py", line 284, in
fetch_build_eggs
parse_requirements(requires), installer=self.fetch_build_egg File "C:\Program Files
(x86)\Python27\lib\site-packages\pkg_resources__init__.py", line 777,
in resolve
replace_conflicting=replace_conflicting File "C:\Program Files (x86)\Python27\lib\site-packages\pkg_resources__init__.py", line
1060, in best_match
return self.obtain(req, installer) File "C:\Program Files (x86)\Python27\lib\site-packages\pkg_resources__init__.py", line
1072, in obtain
return installer(requirement) File "C:\Program Files (x86)\Python27\lib\site-packages\setuptools\dist.py", line 327, in
fetch_build_egg
return cmd.easy_install(req) File "C:\Program Files (x86)\Python27\lib\site-packages\setuptools\command\easy_install.py",
line 434, in easy_install
self.local_index File "C:\Program Files (x86)\Python27\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'
I found it is setuptools issue.
I reinstall the setuptools but it does not work.
Search for "easy_install" in Scripts folder, find some old easy_installxxx pyc,py file/folder which is older than my reinstall date.
Delete them.
Reinstalled the setuptools
easy_install --version
It shows latest version now.
Then do again
python setup.py install
Now it works.
Related
when I try to install build with
sudo pip3 install build
the following error occurs:
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 143, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 386, in run
use_user_site=options.use_user_site,
File "/usr/lib/python3/dist-packages/pip/_internal/req/__init__.py", line 49, in install_given_reqs
**kwargs
File "/usr/lib/python3/dist-packages/pip/_internal/req/req_install.py", line 760, in install
use_user_site=use_user_site, pycompile=pycompile,
File "/usr/lib/python3/dist-packages/pip/_internal/req/req_install.py", line 382, in move_wheel_files
warn_script_location=warn_script_location,
File "/usr/lib/python3/dist-packages/pip/_internal/wheel.py", line 215, in move_wheel_files
prefix=prefix,
File "/usr/lib/python3/dist-packages/pip/_internal/locations.py", line 153, in distutils_scheme
d.parse_config_files()
File "/usr/lib/python3.7/distutils/dist.py", line 406, in parse_config_files
parser.read(filename)
File "/usr/lib/python3.7/configparser.py", line 696, in read
self._read(fp, filename)
File "/usr/lib/python3.7/configparser.py", line 1091, in _read
fpname, lineno)
configparser.DuplicateOptionError: While reading from 'setup.cfg' [line 10]: option 'url' in section 'metadata' already exists
while installing the collected packages. The install never completes; pip says it was never installed. I would greatly appreciate any help troubleshooting.
In the off chance anyone else has this problem, I found a temporary fix that will probably make python stop working in a few days.. I went to ln 1088-1090 of /usr/lib/python3.7/configparser.py and replaced that bit about raising an exception after an if statement with
while (self._strict and
(sectname, optname) in elements_added):
elements_added.pop()
This seemed to have fixed the problem, albeit not in the most pretty method, as installation pf build and use of sdist now works ok.
I am totally new to this. So I installed pipenv using 'pip install pipenv'. I have python version 3.8.2, pip version 20.1.1 and pipenv version 2020.6.2 .
But when I try to run 'pipenv install' it gives the following error.
C:\Users\rd463>pipenv install
Traceback (most recent call last):
File "D:\python382\Lib\site-packages\pipenv\vendor\pythonfinder\models\python.py", line 618, in parse_executable
result_version = get_python_version(path)
File "D:\python382\Lib\site-packages\pipenv\vendor\pythonfinder\utils.py", line 105, in get_python_version
c = subprocess.Popen(version_cmd, **subprocess_kwargs)
File "d:\python382\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "d:\python382\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "d:\python382\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "d:\python382\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "D:\python382\Scripts\pipenv.exe\__main__.py", line 7, in <module>
File "D:\python382\Lib\site-packages\pipenv\vendor\click\core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "D:\python382\Lib\site-packages\pipenv\vendor\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "D:\python382\Lib\site-packages\pipenv\vendor\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "D:\python382\Lib\site-packages\pipenv\vendor\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "D:\python382\Lib\site-packages\pipenv\vendor\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "D:\python382\Lib\site-packages\pipenv\vendor\click\decorators.py", line 73, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "D:\python382\Lib\site-packages\pipenv\vendor\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "D:\python382\Lib\site-packages\pipenv\vendor\click\decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "d:\python382\lib\site-packages\pipenv\cli\command.py", line 232, in install
retcode = do_install(
File "d:\python382\lib\site-packages\pipenv\core.py", line 1921, in do_install
ensure_project(
File "d:\python382\lib\site-packages\pipenv\core.py", line 576, in ensure_project
ensure_virtualenv(
File "d:\python382\lib\site-packages\pipenv\core.py", line 498, in ensure_virtualenv
python = ensure_python(three=three, python=python)
File "d:\python382\lib\site-packages\pipenv\core.py", line 388, in ensure_python
path_to_python = find_a_system_python(python)
File "d:\python382\lib\site-packages\pipenv\core.py", line 350, in find_a_system_python
return next(iter(finder.find_all_python_versions()), None)
File "d:\python382\lib\site-packages\pipenv\vendor\pythonfinder\pythonfinder.py", line 312, in find_all_python_versions
python_version_dict = getattr(self.system_path, "python_version_dict", {})
File "d:\python382\lib\site-packages\pipenv\vendor\pythonfinder\pythonfinder.py", line 120, in system_path
self._system_path = self.create_system_path()
File "d:\python382\lib\site-packages\pipenv\vendor\pythonfinder\pythonfinder.py", line 82, in create_system_path
return pyfinder_path.SystemPath.create(
File "D:\python382\Lib\site-packages\pipenv\vendor\pythonfinder\models\path.py", line 682, in create
instance = instance._run_setup()
File "D:\python382\Lib\site-packages\pipenv\vendor\pythonfinder\models\path.py", line 233, in _run_setup
new_instance = new_instance._setup_windows()
File "D:\python382\Lib\site-packages\pipenv\vendor\pythonfinder\models\path.py", line 411, in _setup_windows
windows_finder = WindowsFinder.create()
File "D:\python382\Lib\site-packages\pipenv\vendor\pythonfinder\models\windows.py", line 146, in create
return cls()
File "<attrs generated init pythonfinder.models.windows.WindowsFinder>", line 13, in __init__
File "D:\python382\Lib\site-packages\pipenv\vendor\pythonfinder\models\windows.py", line 113, in get_versions
versions[py_version.version_tuple[:5]] = base_dir
File "D:\python382\Lib\site-packages\pipenv\vendor\pythonfinder\models\python.py", line 365, in __getattribute__
result = super(PythonVersion, self).__getattribute__(key)
File "D:\python382\Lib\site-packages\pipenv\vendor\pythonfinder\models\python.py", line 430, in version_tuple
self.patch,
File "D:\python382\Lib\site-packages\pipenv\vendor\pythonfinder\models\python.py", line 375, in __getattribute__
instance_dict = self.parse_executable(executable)
File "D:\python382\Lib\site-packages\pipenv\vendor\pythonfinder\models\python.py", line 620, in parse_executable
raise ValueError("Not a valid python path: %r" % path)
ValueError: Not a valid python path: 'D:/program_files/Anaconda3/Scripts/python.exe'
Running 'python -m pipenv.help' gives -
C:\Users\rd463>python -m pipenv.help
$ pipenv --support
Pipenv version: '2020.6.2'
Pipenv location: 'D:\\python382\\lib\\site-packages\\pipenv'
Python location: 'D:\\python382\\python.exe'
Python installations found:
followed by the same error again.
I have python installed in 'D:/python382'
There is no such directory that the error mentions. I have checked my environment variables and everything is fine there too. Please help me with this error.
Thank you for your time.
I think the newer version of pipenv is causing the error, I use this command when having the same issue and it worked for me, just use
pip install pipenv==2018.10.13
I had the same problem when I uninstalled Anaconda. Mine got solved after I did the following steps
run regedit.exe
Go to
Computer\HKEY_CURRENT_USER\Software\Python\PythonCore
If there is/are folders having previous versions of python.Delete every version of python other than your current one(for eg.3.7, 3.8 etc. I also had to delete some folder containing something related to anaconda to solve the problem (other than the previous versions)
I was just struggling with a similar problem with pipenv that was giving me the same error messages.
WinError 2 has to do with corrupted files in one of your Python installs/uninstalls. I searched regedit for Anaconda3 to figure out which version of Python that I had previously installed or uninstalled was causing the problem.
For me, it was Python 3.6.5. I installed it in the same location as the path in the error message (in your case that would be D:/program_files/). Then, I just uninstalled it with the installation exe, and I stopped getting these error messages.
Have you tried the conda install command? To do this, go on your anaconda prompt, cd in the folder where you have installed your anaconda. Have a look at this.
conda install -c conda-forge pipenv
make sure you activate your environment before running the conda install command. To activate your environment run conda activate envname. I hope it helps!
I tried to install scrapy on my windows machine by using pip install scrapy and pip3 install scrapy but it is showing me the following error:
File "<string>", line 1, in <module>
File "C:\Users\ASUS\AppData\Local\Temp\pip-install-8lbz4g3u\Twisted\setup.py", line 20, in <module>
setuptools.setup(**_setup["getSetupArgs"]())
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\__init__.py", line 144, in setup
_install_setup_requires(attrs)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\__init__.py", line 139, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\dist.py", line 716, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "c:\users\asus\desktop\utube\venv\lib\site-packages\pkg_resources\__init__.py", line 780, in resolve
dist = best[req.key] = env.best_match(
File "c:\users\asus\desktop\utube\venv\lib\site-packages\pkg_resources\__init__.py", line 1065, in best_match
return self.obtain(req, installer)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\pkg_resources\__init__.py", line 1077, in obtain
return installer(requirement)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\dist.py", line 786, in fetch_build_egg
return cmd.easy_install(req)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\command\easy_install.py", line 665, in easy_install
dist = self.package_index.fetch_distribution(
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\package_index.py", line 655, in fetch_distribution
dist = find(requirement)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\package_index.py", line 635, in find
loc = self.download(dist.location, tmpdir)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\package_index.py", line 579, in download
found = self._download_url(scheme.group(1), spec, tmpdir)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\package_index.py", line 824, in _download_url
return self._attempt_download(url, filename)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\package_index.py", line 830, in _attempt_download
headers = self._download_to(url, filename)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\package_index.py", line 729, in _download_to
fp = self.open_url(url)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\package_index.py", line 779, in open_url
raise DistutilsError("Download error for %s: %s"
distutils.errors.DistutilsError: Download error for https://files.pythonhosted.org/packages/f5/1d/c98a587dc06e107115cf4a58b49de20b19222c83d7533
5a192052af4c4b7/incremental-17.5.0-py2.py3-none-any.whl#sha256=717e12246dddf231a349175f48d74d93e2897244939173b01974ab6661406b9f: _ssl.c:1091: The h
andshake operation timed out
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
So help me out how to fix this problem.
I have tried to install from pycharm also but it can't install there also
Based on the traceback you provided and this Github Issue the issue appears to be the "incremental" package dependency. You can try installing incremental (17.5.0) using pip install incremental==17.5.0 before installing scrapy.
Note that in the scrapy documentation installation guide it says:
"Though it’s possible to install Scrapy on Windows using pip, we
recommend you to install Anaconda or Miniconda and use the package
from the conda-forge channel, which will avoid most installation
issues."
So you could follow the steps in the documentation if installing incremental doesn't resolve your issues.
I need to install pyspark. It has a dependency on pypandoc. So I first do pip install pypandoc and then pip install pyspark and everything looks fine. However, based on some requirements I need to install my dependencies using a requirements.txt file. So I put both pypandoc and pyspark in the requirements.txt file and then I do pip install -r requirements.txt (pypandoc comes first in the file followed by pyspark), however this time the installation file with the following error
Complete output from command python setup.py egg_info:
Could not import pypandoc - required to package PySpark
Download error on https://pypi.org/simple/pypandoc/: [Errno 97] Address family not supported by protocol -- Some packages may not be found!
Couldn't find index page for 'pypandoc' (maybe misspelled?)
Download error on https://pypi.org/simple/: [Errno 97] Address family not supported by protocol -- Some packages may not be found!
No local packages or working download links found for pypandoc
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-6vmbjchu/pyspark/setup.py", line 224, in <module>
'Programming Language :: Python :: Implementation :: PyPy']
File "/usr/local/lib/python3.6/site-packages/setuptools/__init__.py", line 144, in setup
_install_setup_requires(attrs)
File "/usr/local/lib/python3.6/site-packages/setuptools/__init__.py", line 139, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/usr/local/lib/python3.6/site-packages/setuptools/dist.py", line 724, in fetch_build_eggs
replace_conflicting=True,
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 782, in resolve
replace_conflicting=replace_conflicting
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1065, in best_match
return self.obtain(req, installer)
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1077, in obtain
return installer(requirement)
File "/usr/local/lib/python3.6/site-packages/setuptools/dist.py", line 791, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/local/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 673, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pypandoc')
So it looks like when I do it in this way, the pypandoc is not properly installed when it tries to install pyspark. How can I fix this issue?
I'm on Python 3.6 and trying to use py -m pip install discord.py to install the discord package to write a discord bot. However, that command works most of the way until it says Rolling back uninstall of pip and then it crashes like so:
Exception:
Traceback (most recent call last):
File "C:\Program Files\Python36\lib\site-packages\pip\basecommand.py", line 211, in main
status = self.run(options, args)
File "C:\Program Files\Python36\lib\site-packages\pip\commands\install.py", line 311, in run
root=options.root_path,
File "C:\Program Files\Python36\lib\site-packages\pip\req\req_set.py", line 646, in install
**kwargs
File "C:\Program Files\Python36\lib\site-packages\pip\req\req_install.py", line 803, in install
self.move_wheel_files(self.source_dir, root=root)
File "C:\Program Files\Python36\lib\site-packages\pip\req\req_install.py", line 998, in move_wheel_files
isolated=self.isolated,
File "C:\Program Files\Python36\lib\site-packages\pip\wheel.py", line 449, in move_wheel_files
generated.extend(maker.make(spec))
File "C:\Program Files\Python36\lib\site-packages\pip_vendor\distlib\scripts.py", line 353, in make
self._make_script(entry, filenames, options=options)
File "C:\Program Files\Python36\lib\site-packages\pip_vendor\distlib\scripts.py", line 257, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:\Program Files\Python36\lib\site-packages\pip_vendor\distlib\scripts.py", line 193, in _write_script
launcher = self._get_launcher('t')
File "C:\Program Files\Python36\lib\site-packages\pip_vendor\distlib\scripts.py", line 332, in _get_launcher
result = finder(distlib_package).find(name).bytes
File "C:\Program Files\Python36\lib\site-packages\pip_vendor\distlib\resources.py", line 324, in finder
raise DistlibException('Unable to locate finder for %r' % package)
pip._vendor.distlib.DistlibException: Unable to locate finder for 'pip._vendor.distlib'
You are using pip version 7.1.2, however version 9.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
So I try updating pip with py -m pip install --upgrade pip and it works most of the way until Rolling back uninstall of pip where it says:
Exception:
Traceback (most recent call last):
File "C:\Program Files\Python36\lib\site-packages\pip\basecommand.py", line 211, in main
status = self.run(options, args)
File "C:\Program Files\Python36\lib\site-packages\pip\commands\install.py", line 311, in run
root=options.root_path,
File "C:\Program Files\Python36\lib\site-packages\pip\req\req_set.py", line 646, in install
**kwargs
File "C:\Program Files\Python36\lib\site-packages\pip\req\req_install.py", line 803, in install
self.move_wheel_files(self.source_dir, root=root)
File "C:\Program Files\Python36\lib\site-packages\pip\req\req_install.py", line 998, in move_wheel_files
isolated=self.isolated,
File "C:\Program Files\Python36\lib\site-packages\pip\wheel.py", line 449, in move_wheel_files
generated.extend(maker.make(spec))
File "C:\Program Files\Python36\lib\site-packages\pip_vendor\distlib\scripts.py", line 353, in make
self._make_script(entry, filenames, options=options)
File "C:\Program Files\Python36\lib\site-packages\pip_vendor\distlib\scripts.py", line 257, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:\Program Files\Python36\lib\site-packages\pip_vendor\distlib\scripts.py", line 193, in _write_script
launcher = self._get_launcher('t')
File "C:\Program Files\Python36\lib\site-packages\pip_vendor\distlib\scripts.py", line 332, in _get_launcher
result = finder(distlib_package).find(name).bytes
File "C:\Program Files\Python36\lib\site-packages\pip_vendor\distlib\resources.py", line 324, in finder
raise DistlibException('Unable to locate finder for %r' % package)
pip._vendor.distlib.DistlibException: Unable to locate finder for 'pip._vendor.distlib'
You are using pip version 7.1.2, however version 9.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Oddly enough, trying to just run pip in the command prompt it gives me 'pip' is not recognized as an internal or external command,
operable program or batch file.
I've tried uninstalling with py -m pip uninstall pip setuptools and reinstalling by running py get-pip.py on the python file, none of which seem to do anything.
So I have no way of uninstalling, reinstalling, or upgrading pip, and I can't use the current version of pip to install anything. I've searched for hours and tried changing my PATH variable and looking at file path limits, but I'm completly stuck and very new to this type of thing. I'm on Windows 10.
EDIT: "pip", "pip3", "python" and "python3" commands don't work. "py" command works.
EDIT: I seem to have gotten around using pip this time. I downloaded the discord package from github then followed instructions here which say to run py setup.py install --user. Still, I'd like to be able to use pip in the future.
There are couple solutions. You can reinstall python and during installation add it to environmental variable. Another way would be adding scripts and python to environmental path. http://www.correlatedsolutions.com/support/index.php?/Knowledgebase/Article/View/85/1/running-python-scripts-from-anywhere-under-windows.