ModuleNotFoundError: No module named verovio

2024/11/15 0:24:36

Hi there I would like to run my flask app in a container but I got stucked caused of a third party module. (I am using PyCharm)

This is my docker file:

FROM python:3-alpineMAINTAINER fooCOPY app /appWORKDIR /appRUN pip install -r requirements.txtCMD ["python3", "gateway.py"]

I run the container by this command:

docker run --name mei_converter -p 5000:5000 mei_converter:latest

And receives this:

ModuleNotFoundError: No module named 'verovio'

I already fixed the dependencies in order to run it on my local machine

Terminal: python3 gateway.py['/usr/local/lib/python3.7/site-packages', 
'/Users/max/PycharmProjects/flaskmicroservice/app', 
'/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python37.zip', 
'/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7', 
'/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib- 
dynload', '/Users/max/Library/Python/3.7/lib/python/site-packages', 
'/usr/local/lib/python3.7/site-packages', '/usr/local/lib/python3.7/site-packages/verovio- 
2.0.0-py3.7-macosx-10.13-x86_64.egg']
* Serving Flask app "gateway" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)

This works well

I also checked the project interpreter in PyCharm and found the package as installed.

Maybe some information about this third party package could help: It is a converter for music-encoding from these guys https://www.verovio.org/python.xhtml and not "native python" (SWIG is necessary) By the way.. I come from the java world and have in fact zero experience with python. I am using this flask app as an microservice for my spring boot app. I would be grateful for any help!

Answer

You need to do in the container the same you did in your local host. That is, you need to add steps to the Dockerfile to compile verovio and use it in the container.

https://en.xdnf.cn/q/119351.html

Related Q&A

Python: TypeError: list object is not callable on global variable

I am currently in the process of programming a text-based adventure in Python as a learning exercise. I want "help" to be a global command, stored as values in a list, that can be called at (…

Python beautifulsoup how to get the line after href

I have this piece of html:<a href="http://francetv.fr/videos/alcaline_l_instant_,12163184.html" class="ss-titre">"Paris Combo" </a> <…

Scrapy empty output

I am trying to use Scrapy to extract data from page. But I get an empty output. What is the problem? spider: class Ratemds(scrapy.Spider):name = ratemdsallowed_domains = [ratemds.com]custom_settings =…

nested classes - how to use function from parent class?

If I have this situation:class Foo(object):def __init__(self):self.bar = Bar()def do_something(self):print doing somethingclass Bar(object):def __init(self):self.a = adef some_function(self):I want to …

CUDA Function Wont Execute For Loop on Python with Numba

Im trying to run a simple update loop of a simulation on the GPU. Basically there are a bunch of "creatures" represented by circles that in each update loop will move and then there will be a…

Implementing the Ceaser Cipher function through input in Python

Im trying to create a Ceaser Cipher function in Python that shifts letters based off the input you put in.plainText = input("Secret message: ") shift = int(input("Shift: "))def caes…

Twitter scraping of older tweets

I am doing a project in which I needed to get tweets from twitter, and I used the twitter API but it only gives tweets from 7-9 days old but I want a few months older tweets as well. So I decided to sc…

Bootstrap Navbar Logo not found

Hello I am trying to get my NavBar on bootstrap to show a Logo, I have tried moving the png to different folders in the app but I get this error: System check identified no issues (0 silenced). January…

Why camelcase not installed?

i try to install camelcase in my python project. pip install camelcase but when i want to use the package, pylance give me this error: Import "camelcase" could not be resolved Pylance (report…

Find the two longest strings from a list || or the second longest list in PYTHON

Id like to know how i can find the two longest strings from a list(array) of strings or how to find the second longest string from a list. thanks