Actually I tampered certain libraries of Python 3 and they stopped working, so I want to remove complete Python 3 and reinstall it.
When I ran this command:
sudo dnf remove python3
the result was:
Error:
Problem: The operation would result in removing the following protected packages: dnf
Please suggest me how to remove python3 and reinstall without any dependencies.
Previously I had the same issue with python I ran the same commands and it successfully removed it and then when I installed the same, It installed without any dependent libraries.
I googled and read but didn't find any relevant answers.
It appears that dnf uses python internally. So removing it forcefully will break you package management, and then you are in a much worse situation.
You could remove all installed python packages like this, while still keeping python itself:
for package in $(pip3 freeze); do pip3 uninstall -y $package; done
If that doesn't help because the standard library of Python is broken then try
dnf reinstall python3 -y
Related
Trying to install coremltools. I installed using pip but that is not the most recent version and I have run into a bug that was solved 4 days so I must build from source. I'm on a Mac virtual desktop(windows user) and I tried cmake, but since there are multiple pythons it keeps trying to install to python 3.7 when I need it to install for python 2.7.10. The github suggest doing this:
cmake . -DPYTHON=$(which python) -DPYTHON_CONFIG=$(which python-config)
.. however as someone who doesn't use cmake for package installs I'm unsure of the correct syntax could someone give me an example statement to go off of, I would really appreciate it. Thanks
You can install it without building it manually:
pip install https://github.com/apple/coremltools/archive/master.zip
You can replace "master" with any branch or tag names.
EDIT: To update an existing install add the -U flag. Or uninstall previous installations.
Unfortunately I cannot install any modules on python 3.4 32 Bit using the pip command due to the following error.
How do I get around the problem. I have removed all other installations of python and have installed the 32 Bit version rather than the 64 Bit one?
Thanks
Edit 1:
At the moment I can't even upgrade pip
Edit 2
Unfortunately it still returns an error.
Try upgrading your pip with
python -m pip install -U pip
If this fails too, it has to be a network problem. See if you're properly connected to internet.
Seems like you might be using an old version of PIP which is facing SSL certification issues and is hence unable to connect. You can do a manual reinstall of pip using these commands.:
python -m pip uninstall pip setuptools
Then, download this script
Finally, run the script with:
python get-pip.py
AttributeError: 'module' object has no attribute 'openssl_md_meth_names'
I keep receiving this error when trying to install Flask or any library through pip
I have viewed other attributeerror posts and they have helped but this openssl module has little insight. I did try to install Python 2.7.9
What steps should I take to remove python and preform a fresh install? I executed sudo apt-get remove python earlier and that was a big mistake. I have since recovered from that.
I would try:
sudo apt-get install --reinstall python2.7
I would also then use python2.7 instead of python in the command line to be sure I'm using the correct executable.
What I would do in your case to avoid future headaches is install python via anaconda. Tutorial here: http://docs.continuum.io/anaconda/
With this tool you install python in a different place than the system python and can use different versions and different packages for different projects without breaking your system (although it does have a learning curve). It also has good support for libraries like numpy and the like who can get grumpy when compiled and you can use pip with it.
If you use apt-get to install Python, then you get whatever version of Python is supported by your Linux distribution.
If you are using Debian, you can get 2.7.9 from the "unstable" repos (code-named "sid"). You don't necessarily have to upgrade your whole system to "unstable"; read about "pinning" packages. Pinning is tricky and I avoid it.
You also have the option of simply downloading the Python source code and building it on your system. Then you would run Python 2.7.9 out of /usr/local/bin and you would still have the stable Python supported by your system.
If you do wind up installing your own build of Python, you might want to look into VirtualEnv. http://simononsoftware.com/virtualenv-tutorial-part-2/
In Ubuntu 13.04, I have installed Scrapy for python-2.7, from the tarball. Executing a crawl command results in the below error:
ImportError: Error loading object 'scrapy.telnet.TelnetConsole': No module named conch
I've also tried installing twisted conch using easy_install and using the tarball. I have also removed the scrappy.egg and .info and the main scrappy folder from the python path.
Reinstalling scrapy does not help as well.
Can some one point me in the right direction?
On Ubuntu, you should avoid using easy_install wherever you can. Instead, you should be using apt-get, aptitude, "Ubuntu Software Center", or another of the distribution-provided tools.
For example, this single command is all you need to install scrapy - along with every one of its dependencies that is not already installed:
$ sudo apt-get install python-scrapy
easy_install is not nearly as good at installing things as apt-get. Chances are the reason you can't get it to work is that it didn't quite install things sensibly, particularly with respect to what was already installed on the system. Sadly, it also leaves no record of what it did, so uninstallation is difficult or impossible. You may now have a big mess on your system that prevents proper installations from working as well (or maybe not, you might be lucky). It's difficult to say whether this is the case, since there are a lot of different pieces that go into a working system, and they all need to fit together just right, and it's difficult to enumerate them so you can check them, let alone enumerate the ways they can each be broken.
Ensure you have the python development headers:
apt-get install build-essential python-dev
Install scrapy with pip:
pip install Scrapy
Ubuntu packages
New in version 0.10.
Scrapinghub publishes apt-gettable packages which are generally fresher than those in Ubuntu, and more stable too since they’re continuously built from Github repo (master & stable branches) and so they contain the latest bug fixes.
To use the packages:
Import the GPG key used to sign Scrapy packages into APT keyring:
Step.1
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 627220E7
Create /etc/apt/sources.list.d/scrapy.list file using the following command:
Step.2
echo 'deb http://archive.scrapy.org/ubuntu scrapy main' | sudo tee /etc/apt/sources.list.d/scrapy.list
Update package lists and install the scrapy-0.24 package:
Step.3
sudo apt-get update && sudo apt-get install scrapy-0.24
Note
Repeat step 3 if you are trying to upgrade Scrapy.
Warning
python-scrapy is a different package provided by official debian repositories, it’s very outdated and it isn’t supported by Scrapy team.
I am trying to install python-shapely with pip in Ubuntu 10.04. I got "Unknown or unsupported command 'install'" while I tried,
user#desktop:~$ pip install Shapely
I tried installing pip and got the following error:
user#desktop:~$ sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
python-pip
0 upgraded, 1 newly installed, 0 to remove and 396 not upgraded.
Need to get 0B/49.8kB of archives.
After this operation, 270kB of additional disk space will be used.
(Reading database ... 252574 files and directories currently installed.)
Unpacking python-pip (from .../python-pip_0.3.1-1ubuntu2.1_all.deb) ...
dpkg: error processing /var/cache/apt/archives/python-pip_0.3.1-1ubuntu2.1_all.deb (--unpack):
trying to overwrite '/usr/bin/pip', which is also in package pip 0:0.13-1
Errors were encountered while processing:
/var/cache/apt/archives/python-pip_0.3.1-1ubuntu2.1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I'd appreciate any comment/solution.
Thanks!
Did you install pip first, then get this error, then try to install python-pip?
If so, first remove pip (apt-get remove pip), then install python-pip instead and try again.
(I just had the same problem, not sure if python 2.7 uses pip and 2.6 uses python-pip? That might be the issue.)
Same happen to me, I'm running Ubuntu Lucid Lynx, 10.04 and there's a packaging conflict. Package pip (pearl installation software) has a conflict with the python-pip package. Both of them try to put a pip binary at /usr/bin/pip. You could do several things to solve the problem so choose the one that fits your needs:
1.- Remove "the pearl pip" if you don't use it and install the python pip
2.- Force installation of python pip with some "dpkg -f" or so, but this way your pip binary file will be overwritten
3.- Manually install ether of the packages changing the binary name, i.e. you manually install the python pip and instead of pip you just call the binary "python-pip"
Seems to be broken download. Did you try easy_install?
sudo easy_install pip
The problem raise because pip is in strawberry perl and Python both, if Perl's pip hit this error comes
$ which pip
/cygdrive/c/strawberry/perl/bin/pip
Solution
1. C:\Python27\Scripts\pip install south
or
2. Keep python path before strawberry perl
or
3. remove strawberry perl path from path variable...
Leave everything, Install latest version of python from its https://www.python.org/downloads .It already contain PIP, so open CMD from start and give him path to reach folder where python is installed and open "Script" folder where pip is build-in installed e.g. c:\Python36-32\Script And then write pip install module_name and enjoy,,,
Possibly you will have to open Administrator CMD, SO after typing cmd in start when you see CMD is on list press CTRL+SHIFT+ENTER and press OK in pop-up dialog and you will have administrative CMD.