To install the package readPTU I added a line git+URL in requirments.txt. However when trying to import the package I get the import error :
File “/home/appuser/venv/lib/python3.7/site-packages/readPTU/readPTU.py”, line 33, in from ._readTTTRRecords_HHT2_HH2 import ffi, lib
This file should have been created when running the setup.py of ReadPTU if the right compiler was present.
I’m not sure what to add to packages.txt so that the installation of the package runs fine on the cloud. I tried adding “clang”, “gcc” or “cmakes” but none of those worked. Can you help me figure it out?
Hi @randyzwitch, thanks for your answer. Unfortunatly it did’t work. It seems that the packages is not being installed properly. It works fine on any computer if I clone the repo and run the setup.py file from shell. Is there a way to do something similar ou the cloud?
ModuleNotFoundError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs.
Traceback:
File "/home/appuser/venv/lib/python3.7/site-packages/streamlit/script_runner.py", line 354, in _run_script
exec(code, module.__dict__)File "/app/fitmydata/app.py", line 74, in <module>
exec(open('fit_g2.py').read())File "<string>", line 18, in <module>File "/app/fitmydata/from_PTU.py", line 13, in <module>
from readPTU import PTUfile, PTUmeasurementFile "/home/appuser/venv/lib/python3.7/site-packages/readPTU/__init__.py", line 1, in <module>
from .readPTU import *File "/home/appuser/venv/lib/python3.7/site-packages/readPTU/readPTU.py", line 33, in <module>
from ._readTTTRRecords_HHT2_HH2 import ffi, lib
@randyzwitch unfortunatly my repo is not ready to go public yet. Do you know any public repo that uses a package that requires a compiler so that I can check what they do differently?
I actually found the solution. The issue is that GitHub - QuantumPhotonicsLab/readPTU: A Python library to read PTU files from PicoQuant can’t work when installed through pip install . because the compiled files are writtent in the readPTU folder after the package has been installed in your Python site-packages folder.
I opened a PR to do the compile in a build step prior to the installation of the package, so that the compiled files are included in the final Python package installed on your system.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.