Python-pip : Invoice2data package installation error through pip - python

I am trying to install invoice2data package through pip but i am getting the following error :
ERROR: Exception: Traceback (most recent call last): File
"/home/webwerks/.local/lib/python2.7/site-packages/pip/_internal/cli/base_command.py",
line 178, in main status = self.run(options, args) File
"/home/webwerks/.local/lib/python2.7/site-packages/pip/_internal/commands/install.py",
line 414, in run use_user_site=options.use_user_site, File
"/home/webwerks/.local/lib/python2.7/site-packages/pip/_internal/req/__init__.py",
line 58, in install_given_reqs
**kwargs File "/home/webwerks/.local/lib/python2.7/site-packages/pip/_internal/req/req_install.py",
line 922, in install use_user_site=use_user_site, pycompile=pycompile,
File
"/home/webwerks/.local/lib/python2.7/site-packages/pip/_internal/req/req_install.py",
line 448, in move_wheel_files
warn_script_location=warn_script_location, File
"/home/webwerks/.local/lib/python2.7/site-packages/pip/_internal/wheel.py",
line 428, in move_wheel_files assert info_dir, "%s .dist-info
directory not found" % req AssertionError: invoice2data .dist-info
directory not found
Ubuntu : 16.04
python : Python 2.7.12
pip : pip 19.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)
I have tried uninstalling pip completely and then reinstalling again still I get the same error. Also tried other StackOverflow solutions but still it didn't help.

i tried the command in python 3.7.2 and it was installed succesfully. This is the command used
"python -m pip install invoice2data"

Related

pip uninstall GDAL gives AttributeError: 'PathMetadata' object has no attribute 'isdir'

I'm trying to pip install geopandas as a fresh installation, so I want to remove existing packages like GDAL and fiona. I've already managed to pip uninstall fiona, but when I try to uninstall or reinstall GDAL it gives the following error message:
(base) C:\usr>pip install C:/usr/Anaconda3/Lib/site-packages/GDAL-3.4.1-cp38-cp38-win_amd64.whl
Processing c:\usr\anaconda3\lib\site-packages\gdal-3.4.1-cp38-cp38-win_amd64.whl
Installing collected packages: GDAL
Attempting uninstall: GDAL
Found existing installation: GDAL 3.0.2
ERROR: Exception:
Traceback (most recent call last):
File "C:\usr\Anaconda3\lib\site-packages\pip\_internal\cli\base_command.py", line 167, in exc_logging_wrapper
status = run_func(*args)
File "C:\usr\Anaconda3\lib\site-packages\pip\_internal\cli\req_command.py", line 205, in wrapper
return func(self, options, args)
File "C:\usr\Anaconda3\lib\site-packages\pip\_internal\commands\install.py", line 405, in run
installed = install_given_reqs(
File "C:\usr\Anaconda3\lib\site-packages\pip\_internal\req\__init__.py", line 68, in install_given_reqs
uninstalled_pathset = requirement.uninstall(auto_confirm=True)
File "C:\usr\Anaconda3\lib\site-packages\pip\_internal\req\req_install.py", line 637, in uninstall
uninstalled_pathset = UninstallPathSet.from_dist(dist)
File "C:\usr\Anaconda3\lib\site-packages\pip\_internal\req\req_uninstall.py", line 554, in from_dist
for script in dist.iterdir("scripts"):
File "C:\usr\Anaconda3\lib\site-packages\pip\_internal\metadata\pkg_resources.py", line 156, in iterdir
if not self._dist.isdir(name):
File "C:\usr\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2816, in __getattr__
return getattr(self._provider, attr)
AttributeError: 'PathMetadata' object has no attribute 'isdir'
Does anyone know why GDAL cannot be uninstalled?
I just came across this question after getting the same error. Coincidentally I had just upgraded pip (I was getting tired of the yellow warnings).
All I had was to down grade my pip
pip install pip==21.3.1 --user
I was seeing the same AttributeError as you when trying to install google-cloud-firestore. My solution was to upgrade my version of pip. In my case, I upgraded to pip from 22.0.2 to 22.3.1
pip install --upgrade pip

Python 3.7 - PIP upgrade error on windows 10

I tried to update PIP (Windows 10, Python 3.7.1) in console using command:
python37 -m pip install --upgrade pip
This is an error I got everytime I try to update it:
>Exception:
Traceback (most recent call last):
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\req\req_set.py", line 784, in install
**kwargs
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\req\req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\wheel.py", line 462, in move_wheel_files
generated.extend(maker.make(spec))
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 372, in make
self._make_script(entry, filenames, options=options)
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 276, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 212, in _write_script
launcher = self._get_launcher('t')
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 351, in _get_launcher
result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'
Surprising fact - I had succesfully updated PIP on Python 2.7 isntance without any problems.
I faced this error while trying to upgrade from pip version 18.1 to 19.0.3.
After a lot of search I hit the solution at https://packaging.python.org/tutorials/installing-packages/
(If that still doesn’t allow you to run pip:
Securely Download get-pip.py [1]
Run python get-pip.py. [2] This will install or upgrade pip. Additionally, it will install setuptools and wheel if they’re not installed already.)
The link there takes you to:
Use https://bootstrap.pypa.io/get-pip.py
Download and save the file, run it from command prompt. It worked like a charm for me.
You can try:
python -m pip install -U --force-reinstall pip

Permission denied error in pip installing pyopenssl

As I'm trying to force reinstall pyopenssl, I'm running into the following error when it tries to install pycparser. I am doing this on Windows 7 64-bit with Python 2.7 using the following command:
pip install pyopenssl --ignore-installed
Here is the traceback:
Exception:
Traceback (most recent call last):
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip-8.1.2-py2.7.egg\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip-8.1.2-py2.7.egg\pip\commands\install.py", line 317, in run
prefix=options.prefix_path,
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip-8.1.2-py2.7.egg\pip\req\req_set.py", line 742, in install
**kwargs
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip-8.1.2-py2.7.egg\pip\req\req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip-8.1.2-py2.7.egg\pip\req\req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip-8.1.2-py2.7.egg\pip\wheel.py", line 346, in move_wheel_files
clobber(source, lib_dir, True)
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip-8.1.2-py2.7.egg\pip\wheel.py", line 324, in clobber
shutil.copyfile(srcfile, destfile)
File "C:\Python27\ArcGIS10.4\lib\shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: 'C:\\Python27\\ArcGIS10.4\\Lib\\site-packages\\_cffi_backend.pyd'
Here is what I have noticed:
It only happens with _cffi_backend.pyd - other packages install and
uninstall fine.
I can pip uninstall cffi and re-install it alright, but whenever it
is present, the _cffi_backend.pyd permission error presents. This means that any installations calling cffi (for example pyopenssl) will fail.
Here is what I've tried:
Uninstalling and reinstalling cffi: no effect
Successfully used icalcs to set _cffi_backend.pyd to full access, everyone: no effect
Calling pip with python -m pip install pyopenssl --ignore-installed: no effect
Closed all applications and examined running processes before
installing: no effect
Reboot. Voodoo for the most part, but just to be thorough: no effect

python pip not working on requirements.txt after OS X 10.8 macports install

Recently bought a new Mac and was setting it up for both Python and iOS development. Python was working fine--especially pip'ing git repos with lots of requirements.txt dependencies UNTIL I installed Xcode, macports and Apple's command line tools.
Now pip works fine for individual install (e.g., pip install twilio), but whenever I run pip against a requirements.txt file it fails (with or without sudo):
pip install ./requirements.txt
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/basecommand.py", line 107, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/commands/install.py", line 225, in run
InstallRequirement.from_line(name, None))
File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 118, in from_line
return cls(req, comes_from, url=url)
File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 43, in __init__
req = pkg_resources.Requirement.parse(req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2510, in parse
reqs = list(parse_requirements(s))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2436, in parse_requirements
line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2404, in scan_list
raise ValueError("Expected "+item_name+" in",line,"at",line[p:])
ValueError: ('Expected version spec in', './requirements.txt', 'at', '/requirements.txt')
My $PATH value is
/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin
This looks different than the "Python pip broken after OS X 10.8 upgrade" thread. I am wonder if macports created a conflict between looking in /System/Libary and ~/Library.
Any ideas?
If you want to install packages through a requirements file, you need the --requirement/-r option:
$ pip install -r requirements.txt
$ pip3 install -r requirements.txt

Error when trying to create virtualenv

I can't create a new virtual environment because of the following error:
$ virtualenv env
New python executable in env/bin/python
Installing distribute....done.
Complete output from command /var/www/vhosts/example.com/...ython /var/www/vhosts/example.com/...stall /usr/lib/pymodules/python2.6/v...ar.gz:
error: Not a URL, existing file, or requirement spec: '/usr/lib/pymodules/python2.6/virtualenv_support/pip-0.6.3.tar.gz'
----------------------------------------
Traceback (most recent call last):
File "/usr/bin/virtualenv", line 9, in <module>
load_entry_point('virtualenv==1.4.5', 'console_scripts', 'virtualenv')()
File "/usr/lib/pymodules/python2.6/virtualenv.py", line 537, in main
use_setuptools=options.use_setuptools)
File "/usr/lib/pymodules/python2.6/virtualenv.py", line 630, in create_environment
install_pip(py_executable)
File "/usr/lib/pymodules/python2.6/virtualenv.py", line 390, in install_pip
filter_stdout=_filter_setup)
File "/usr/lib/pymodules/python2.6/virtualenv.py", line 598, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /var/www/vhosts/example.com/...ython /var/www/vhosts/example.com/...stall /usr/lib/pymodules/python2.6/v...ar.gz failed with error code 1
I have already searched the web but couldn't find any solution to this problem. I'm using Ubuntu 10.04.4 LTS with Python 2.6.5 and Virtualenv 1.7.2, any help appreciated. :)
I just figured it out myself: I tried to install virtualenv with apt-get install python-virtualenv.
Executing apt-get purge python-virtualenv && easy_install virtualenv solved the problem.
I'm seeing the same issue, and I did install "python-virtualenv" via "easy_install" instead of "apt-get".

Categories

Resources