Please help me to resolve this issue about the removing of the python directory. There is the stack trace of my bug when I try to remove the python directory using the following command apt-get autoremove python
ImportError: No module named debpython
dpkg: error processing python-pkg-resources (--remove):
subprocess installed pre-removal script returned error exit status 1
Removing python-psutil ...
Traceback (most recent call last):
File "/usr/sbin/update-python-modules", line 16, in <module>
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
have you tried
sudo apt-get purge *your-program-name*
this will totally (well... almost) delete your program and its library(ies)
Hope this helps
Well, I find the solution and it's works for me when I use the following command:
$ pip uninstall python
Related
Hey after making some changes in the bashrc I tried to use
source ~/.bashrc
but got the following error
baaz#FireStorm:~$ source ~/.bashrc
Traceback (most recent call last):
File "/usr/lib/python3.5/dbm/gnu.py", line 4, in <module>
from _gdbm import *
ImportError: No module named '_gdbm'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 7, in <module>
import dbm.gnu as gdbm
File "/usr/lib/python3.5/dbm/gnu.py", line 6, in <module>
raise ImportError(str(msg) + ', please install the python3-gdbm package')
ImportError: No module named '_gdbm', please install the python3-gdbm package
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/command-not-found", line 27, in <module>
from CommandNotFound.util import crash_guard
File "/usr/lib/python3/dist-packages/CommandNotFound/__init__.py", line 3, in <module>
from CommandNotFound.CommandNotFound import CommandNotFound
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 9, in <module>
import gdbm
ImportError: No module named 'gdbm'
I tried using the install commands as mentioned in the error
baaz#FireStorm:~$ sudo apt-get install python3-gdbm
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-gdbm is already the newest version (3.6.5-3~16.04.york0.2).
python3-gdbm set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Also some solutions mentioned to use version specific commands, but still got no solution
baaz#FireStorm:~$ sudo apt-get install python3.5-gdbm
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python3.5-gdbm is a virtual package provided by:
python3-gdbm 3.5.1-1 [Not candidate version]
E: Package 'python3.5-gdbm' has no installation candidate
The pip install command gave the following error
baaz#FireStorm:~$ sudo pip3 install gdbm --upgrade
The directory '/home/baaz/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/baaz/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting gdbm
Could not find a version that satisfies the requirement gdbm (from versions: )
No matching distribution found for gdbm
Please suggest a way to sort out these error.
Your error is occurring most likely because your .bashrc contains a typo somewhere, therefore command-not-found is being called, but command-not-found appears to have been recently broken. (You should get the same error if you type some nonsense into your terminal directly.)
sudo apt install python3-gdbm=3.5.1-1
worked for me.
From running
dpkg -L python3-gdbm
it looked like gdbm on my computer is being installed to python3.6 for some reason, not python3.5, but my python3 version is python3.5 (and last I checked python3.6 breaks something on ubuntu 16.04).
The error you got when you ran
sudo apt-get install python3.5-gdbm
complained about a version issue, hence manually installing the version they noted worked.
This worked for me:
sudo ln -s /usr/lib/python3.6/lib-dynload/_gdbm.cpython-36m-x86_64-linux-gnu.so /usr/lib/python3.5/lib-dynload/_gdbm.cpython-35m-x86_64-linux-gnu.so
Note the 35m in the the link's name.
I am new to Python and I am trying to install recsys package.
http://ocelma.net/software/python-recsys/build/html/installation.html
For this i need to install some pre-requiste packages, so i have to run this using pip
pip install csc-pysparse networkx divisi2
But whenever i run this i get the following in logs
Collecting csc-pysparse
Using cached csc-pysparse-1.1.1.4.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\64\AppData\Local\Temp\pip-build-wn7_65_9\csc-pysparse\
setup.py", line 33
print 'setuptools module not found.'
^
SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\i054564\
AppData\Local\Temp\pip-build-wn7_65_9\csc-pysparse\
I checked that setuptools exist in my python installation here
C:\Python34\lib\site-packages
I have ran everything from unstinalling setuptools to install it again, upgrade command, but it does not work.
Not able to figure out why setuptools is not found. Is it not found in the path of where pip resolves it from ?
cheers,
Saurav
The code triggering the error is Python 2-specific and is illegal in Python 3.
Apparently, csc-pysparse doesn't support Python 3 (its README only mentions 2.6) and looks abandoned (6 years since last commit).
Some guys out there suggest replacing it with SciPy.
The error is coming from the installation code of recsys package. In order to avoid this error, you need to install setuptools separately.
For debian machines, the below command will work.
sudo apt-get install python3-setuptools
For other machines, please checkout installation instructions at the link
Once setuptools package is installed, you can proceed with csc-pysparse installation.
N00b Altert.
So I tried to call "import requests" through Python and got the error:
>>> import requests
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named requests
I do not think I have pip installed correctly or at all?
easy_install requests returns:
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-6488.pth'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/Library/Python/2.7/site-packages/
Any help on this would be greatly appreciated... I have seen the other posts with users mentioning the same but it doesn't seem to help.
According to the requests website installation page:
Checkout the git repository
execute /path/to/virtualenv/bin/python requests/setup.py install
As a third step, if you have problems doing this, please come back and leave a comment, such that I may help you further.
Your problem is a permissions problem. The solution I'd recommend is to pip install virtualenv and create a new environment for your project, installing requests in that environment.
To install pip, do a curl -kO https://bootstrap.pypa.io/get-pip.py and run it as python get-pip.py then install virtualenv as in the above paragraph.
Type
import requests
Guide your cursor to the command (Donot press space) You will see a red bulb.There will be an option to install requests. Click it and done.
This worked for me on Pycharm. Installing it through pip didnot help me.
Whenever i try to install a package with apt-get install I would encounter the following error:
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up python-support (1.0.15) ...
File "/usr/sbin/update-python-modules", line 52
print x
^
SyntaxError: Missing parentheses in call to 'print'
dpkg: error processing package python-support (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up mercurial-common (3.1.2-2+deb8u1) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package mercurial-common (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mercurial:
mercurial depends on mercurial-common (= 3.1.2-2+deb8u1); however:
Package mercurial-common is not configured yet.
dpkg: error processing package mercurial (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
python-support
mercurial-common
mercurial
E: Sub-process /usr/bin/dpkg returned an error code (1)
I am currently using Python 3.4.2 on my machine.
Did you change your default python from Python2 to Python3? Currently, Debian comes with a default Python2 installation. System scripts written in Python such as /usr/sbin/update-python-modules expect python to run a version of Python2. Changing the default python to Python3 will cause all sorts of scripts to break. If you did make Python3 the default, the way to fix your current problem is to revert and make Python2 the default again.
In Python2 print is a statement, so print x is valid.
In Python3 print is a function, so calling the function requires wrapping the arguments inside parentheses. So print x must be changed to print(x). print x raises a SyntaxError:
File "/usr/sbin/update-python-modules", line 52
print x
^
SyntaxError: Missing parentheses in call to 'print'
Instead of changing the system's default python, use pyenv or virtualenv to manage / switch between multiple versions of Python.
This problem occur after I try to use the script to install Maya 2014 and because I failed with some libraries, I used synaptic package manager to completely remove Maya and I used
sudo rm -r /usr/autodesk
After that I used Terminal to install Skype and get this error message
Setting up composite-2014 (2014.0-862716) ...
python: can't open file '/usr/autodesk/Composite_2014/etc/configure.py': [Errno 2] No such file or directory
dpkg: error processing composite-2014 (--configure):
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
composite-201400
E: Sub-process /usr/bin/dpkg returned an error code (1)
I will now install Wine and put the whole process and it will be more clear where the error occur.
Here's the installation process
Errors were encountered while processing:
composite-2014
E: Sub-process /usr/bin/dpkg returned an error code (1)
try this commands:
apt-get install -f
dpkg-reconfigure -a
maybe helps
If the last answer don't work as well (like it happens to me .. and its rear)
Just "Fake" /usr/autodesk/Composite_2014/etc/configure.py
Open the Terminal (ctl+alt+t)
sudo nautilus
Browse to /usr/autodesk and create Composite_2014/etc/configure.py (one by one)
good luck