@enzo In submission terminal logs “NameError: name ‘pycatch22’ is not defined” I am getting this error though i am doing pip install can you please explain what could be the possible issues.
Another cruncher had the same problem, your issues could be related: Module error pycatch22 - #2 by enzo
To make it short, make sure you have an import pycatch22 at the top level, not in a function.
There is one similar problem with ruptures; when we import ruptures inside the try and except block, it was not working, and the other cruncher is my teammate.
so you suggest to normally use import pycatc22 and import ruptures?
I am guessing you are doing it in a try-except block to install it if missing?
try:
import pycatch22
except ImportError:
os.system("pip install pycatch22")
import pycatch22
What you could do it to reimport it after the try-except:
try:
import pycatch22
except ImportError:
os.system("pip install pycatch22")
import pycatch22
This way it will be properly detected.
But if you are doing more custom, like setting up some flags to disable behavior if the library is missing, it will be trickier:
- If you are just disabling behavior that is fine, you can use the
# @crunch/keep:onto disable the commenter - If you are doing more, you will likely need to use the Hybrid setup, and write your own
requirements.txt, but that not very convenient with Google Colab…
In the future we might expend the support for embedded files for the requirements.txt file, or try to parse !pip install commands, but that is currently not supported.