ModuleNotFoundError: No module named 'librepo' - python

I recently tried to setup https://github.com/NVIDIA/FastPhotoStyle/ locally (issues with Docker that I've been waiting for stability prevented that). After installation, my DNF has started throwing errors due to a missing librepo module.
I'm using Fedora 27.
I've gathered that it has changed how Python loads it's modules (possibly due to Conda, I'm not 100% sure), but I'm struggling to get it working again.
I've tried to install the following packages:
http://fedora.is.co.za/linux/releases/27/Everything/x86_64/os/Packages/p/python3-librepo-1.8.0-1.fc27.x86_64.rpm
http://fedora.is.co.za/linux/releases/27/Everything/x86_64/os/Packages/p/python2-librepo-1.8.0-1.fc27.x86_64.rpm
but to no avail.
I've tried to locate the librepo packages in the pip or conda repositories, again to no avail.
Any command with DNF outputs the following:
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
ModuleNotFoundError: No module named 'librepo'
I'd appreciate any help or insight as I've been googling a fair bit, but have yet to come to a solution

Related

How can I fix ModuleNotFoundError: No module named 'similarity.normalized_levenshtein'?

So I keep having this error ModuleNotFoundError: No module named 'similarity.normalized_levenshtein' in my error log for some reasons.
This is what I was trying to do:
from similarity.normalized_levenshtein import NormalizedLevenshtein
normalized_levenshtein = NormalizedLevenshtein()
This is what was shown:
Traceback (most recent call last):
File "API.py", line 10, in <module>
import nlp3_model
File "C:\Users\Admin\ai-challenge\nlp-3-api\fastml\lib\site-packages\import_ipynb.py", line 61, in load_module
exec(code, mod.__dict__)
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'similarity.normalized_levenshtein'
(fastml)
I have already installed similarity, python-levenshtein, and Levenshtein according to what was in pip list.
Also it's weird because when I tried to run my .ipynb notebook with this line, it works fine, there were no errors. When I imported the .ipynb to a python file, there was this error. I have tried to uninstall and reinstall the package several times and have already double-checked to see that it is in my venv.
I would really appreciate all the support. Thank you so much

"ImportError: No module named six" ubuntu 20.04

when running "src/bitmessagemain.py" in the terminal it shows
Traceback (most recent call last):
File "src/bitmessagemain.py", line 33, in <module>
import shared
File "/home/otsudo/Desktop/PyBitmessage-0.6/src/shared.py", line 19, in <module>
import highlevelcrypto
File "/home/otsudo/Desktop/PyBitmessage-0.6/src/highlevelcrypto.py", line 16, in <module>
from bmconfigparser import BMConfigParser
File "/home/otsudo/Desktop/PyBitmessage-0.6/src/bmconfigparser.py", line 10, in <module>
from six import string_types
ImportError: No module named six
I am guessing it has to do something with the virtualenv due to bitmessage still running on python 2.7 but I cant figure it out. I've made the environment for bitmessage to run in and I keep getting the error.
You probably don't have the six Python module installed,
try this:
pip install six

Jupyter server cannot start

I am using Macbook and was running the Jupyter server fine in the past. For nearly 3 weeks I didn't use it, and now having trouble as it isn't running.
$ jupyter notebook
Traceback (most recent call last):
File "/usr/local/bin/jupyter-notebook", line 6, in <module>
from notebook.notebookapp import main
File "/usr/local/lib/python3.7/site-packages/notebook/notebookapp.py", line 62, in <module>
from tornado import httpserver
File "/usr/local/lib/python3.7/site-packages/tornado/httpserver.py", line 29, in <module>
import ssl
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: dlopen(/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ssl.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ssl.cpython-37m-darwin.so
Reason: image not found
Uninstall and re-installing jupyter didn't fix it.
MacOS Catalina
Version 10.15.2 (19C57)
Any idea how to fix this?
Looks like a problem with your brew-installed openssl, try this: https://github.com/kelaberetiv/TagUI/issues/86
That being said, I have had issues in the past where homebrew updates my python version and breaks everything, so it might be worth investigating that as well

ImportError: No module named _io

When I compile my python scripts I'm getting the following error message. This started happening when I installed Anaconda. I've tried to find a solution online to the problem but I've had no luck. Can anyone help with solving this?
Traceback (most recent call last):
File "query.py", line 1, in <module>
import mysql.connector
File "/usr/local/lib/python2.7/dist-packages/mysql/connector/__init__.py", line 37, in <module>
from .connection import MySQLConnection
File "/usr/local/lib/python2.7/dist-packages/mysql/connector/connection.py", line 27, in <module>
from io import IOBase
File "/usr/lib/python2.7/io.py", line 51, in <module>
import _io
ImportError: No module named _io
Are you using virtualenv? When I ran into this issue it was because of some server update which messed with the python version being used by my virtualenv. I solved the problem by deleting the virtualenv and making a new identical one.

pip3 not installing in correct folder

While python3 expects modules to be in /usr/local/lib/python3.4, pip3 installs them in /usr/local/lib/python3.4/dist-packages. This results in python3 not finding packages that pip3 says are installed.
I tried cutting and pasting the stuff in /usr/local/lib/python3.4/dist-packages to /usr/local/lib/python3.4, but I end up with weird errors, like this:
Traceback (most recent call last):
File "setup.py", line 13, in <module>
from Cython.Build import cythonize
File "/usr/local/lib/python3.4/Cython/Build/__init__.py", line 1, in <module>
from .Dependencies import cythonize
File "/usr/local/lib/python3.4/Cython/Build/Dependencies.py", line 51, in <module>
from ..Compiler.Main import Context, CompilationOptions, default_options
File "/usr/local/lib/python3.4/Cython/Compiler/Main.py", line 30, in <module>
from .Symtab import ModuleScope
File "/usr/local/lib/python3.4/Cython/Compiler/Symtab.py", line 18, in <module>
from . import PyrexTypes
File "/usr/local/lib/python3.4/Cython/Compiler/PyrexTypes.py", line 17, in <module>
from .Code import UtilityCode, LazyUtilityCode, TempitaUtilityCode
ImportError: /usr/local/lib/python3.4/Cython/Compiler/Code.cpython-34m.so: undefined symbol: PyFPE_jbuf
What do I do now? I'm on Linux Mint Cinnamon 64-bit.
[EDIT]
This problem was a complete mess and I still have no clue what happened before. I have given up trying to get Python to work, as I have found an application that does the same thing as the Python application I was trying to get working. It's such a pain.

Categories