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.