Hi, new user here!
I am currently on Fedora 28.
So I wanted to install Keras (lib for neural networks) so I followed this tutorial: MNIST Handwritten Digit Recognition in Keras - Nextjournal
Which uses conda that I downloaded. Then I downloaded keras using pip. (I’m describing everything because I don’t know when the problem happened). From that moment, dnf has stopped working and I suspect that conda has changed dnf’s dependencies…
I get the following log:
dnf
Traceback (most recent call last):
File "/usr/bin/dnf", line 57, in <module>
from dnf.cli import main
File "/usr/lib/python3.6/site-packages/dnf/__init__.py", line 31, in <module>
import dnf.base
File "/usr/lib/python3.6/site-packages/dnf/base.py", line 26, in <module>
from dnf.comps import CompsQuery
File "/usr/lib/python3.6/site-packages/dnf/comps.py", line 29, in <module>
import dnf.util
File "/usr/lib/python3.6/site-packages/dnf/util.py", line 32, in <module>
import librepo
File "/usr/lib64/python3.6/site-packages/librepo/__init__.py", line 1077, in <module>
import librepo._librepo
ImportError: /lib64/libcurl.so.4: symbol SSLv3_client_method version OPENSSL_1_1_0 not defined in file libssl.so.1.1 with link time reference
I have no idea how to fix that, can anyone help on that issue?
Thanks in advance!
Hello @arthamios—welcome to the community! Please take a minute to go through the posts in #start-here here if you haven’t already.
A few questions:
normally, ananconda is installed in your user directory (~/) so that it doesn’t interefere with system files—is that the case here?
similarly, when you installed keras with pip, was it installed in the anaconda environment so that it did not interfere with the system’s python installation?
If conda and pip did not touch the system python installation, which they normally don’t, all you have to do is deactivate the conda environment that you’re running, and then dnf should run just fine.
When a conda environment is activated, conda simply mangles python paths so that its files are visible before the system-wide python installation.
On my computer it is installed in /usr/sbin, /usr/libexec and /usr/share (that’s what whereis told me)
However, even if Keras is installed, I don’t know where it is, the download process did not specify where it was installed, can you explain how to know that?
Same way, I have never used conda, I don’t really know what it is, so I don’t know what you mean by deactivating it…
When you used pip to install it, did you use sudo? If you did not, it should not have touched system files.
Ah, you should read up on it a bit—it’s a good tool, but you need to understand how it works if you want to use it well.
Generally, when you install anaconda and use it to install packages, it does so in a new environment—to ensure that it doesn’t mess with your system’s python installation. So, you can have multiple conda environments and install different packages and use different versions of python. It’s a slightly advanced version of python virtual environments.
However, when you activate an environment, conda loads its files—which may not match and work with the system python. dnf needs system python and system libraries—it may not work with the conda packages.
Take a look at this page to understand conda environments. It’ll tell you how to list them, how to activate them, how to deactivate them. I suspect deactivating your current environment should hopefully fix your issue (if the sytem files were not messed up by installing conda initially):
Mh I don’t remember having installed it manually, so it either was on my computer natively or was installed as a dependency. I’m almost never using python, but when I do I use Pycharm, maybe it installed it.
No, pip makes no such claims. It is simply a tool to install packages from PyPi. How and where these are installed is left up to the user.
This is the usecase that anaconda and python virtual environments aim to address. Every user, with or without sudo access can create a new virtual environment in their home folders and install whatever packages they wish without interacting with the system-wide python installation at all. They can have multiple virtual environments too—so you can have one for keras, another for another tool—all independent of each other. When using root in general, you should be more careful to see what’s being done.
I suspect deactivating your current environment should hopefully fix your issue (if the sytem files were not messed up by installing conda initially):
Well, that did not work unfortunately…: conda deactivate dnf Traceback (most recent call last): File "/usr/bin/dnf", line 57, in <module> from dnf.cli import main File "/usr/lib/python3.6/site-packages/dnf/__init__.py", line 31, in <module> import dnf.base File "/usr/lib/python3.6/site-packages/dnf/base.py", line 26, in <module> from dnf.comps import CompsQuery File "/usr/lib/python3.6/site-packages/dnf/comps.py", line 29, in <module> import dnf.util File "/usr/lib/python3.6/site-packages/dnf/util.py", line 32, in <module> import librepo File "/usr/lib64/python3.6/site-packages/librepo/__init__.py", line 1077, in <module> import librepo._librepo ImportError: /lib64/libcurl.so.4: symbol SSLv3_client_method version OPENSSL_1_1_0 not defined in file libssl.so.1.1 with link time reference
I guess removing conda would do the trick, but then I would not know how to reinstall it properly
it does not seem to require the use of sudo at all, so you shouldn’t use it if you install keras again.
it installs a version of openssl different from the fedora version. So, if you used sudo and it overwrote the system version, that could be the cause of the error you are seeing.
At first I did not use sudo, but the first step failed because it needed to write in a write-protected directory, so I had to use sudo (which I kept using).
Sorry… used -sa instead of -qa, here is the result:
I am thinking about reinstalling the whole OS… But before that I might try reinstalling dnf or python, might fix it. Do you have any other solution @FranciscoD ?
sudo rpm -ivh dnf-2.7.5-12.fc28.src.rpm
Updating / installing...
dnf-2.7.5-12.fc28 warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
################################# [100%]
I still have the same issue as before…
Why not? Isn’t that dnf?
Well I am usually using dnf to update to the newer version of fedora, so…
There is also a tool: koji (sudo dnf install koji).
Then you can download the various RPMs associated with a build (the number you can see in the web page).
cd ~/Downloads && koji download-build -a noarch 1073265