Sagemaker - pip errors when I clone code from github - AlgorithmError: InstallModuleError: No .egg-info

0

Hi everyone, I have a very strange problem with my Sagemaker. I have all the code for my training job on GitHub, and the idea was then to pull it on my Sagemaker Studio instance and run it from there. The problem is that when I launch the Training Job, I get this error and the cell is interrupted:

UnexpectedStatusException: Error for Training job tensorflow-training-2023-06-21-08-50-56-592: Failed. Reason: AlgorithmError: InstallModuleError: Command "/usr/local/bin/python3.7 -m pip install . -r requirements.txt" DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default. pip 21.3 will remove support for this functionality. You can find discussion regarding this athttps://github.com/pypa/pip/issues/7555. ERROR: No .egg-info directory found in /tmp/pip-pip-egg-info-1wdkqvhj WARNING: You are using pip version 21.1.1; however, version 23.1.2 is available. You should consider upgrading via the '/usr/local/bin/python3.7 -m pip install --upgrade pip' command., exit code: 1

I tried to figure it out using the information the error gives, but I could not find a solution. The bizarre thing? If I create a folder outside the one cloned from GitHub and copy-paste all the files there, everything is working correctly, without modifying anything else. It is very chaotic to work like this, can someone help me? Thank you

asked a year ago322 views
2 Answers
1

Hi, did you try to first upgrade pip (as part of initial code of your notebook): it seems that pip is obsolete. So, updating it as suggested at end of error message won't hurt. It may even solve your issue.

Look for %pip in https://ipython.readthedocs.io/en/stable/interactive/magics.html

profile pictureAWS
EXPERT
answered a year ago
  • Hi, yes I did before all the imports. But I also thought that if I update it in the Notebook, I wouldn't have any effect on the machine it is created for the Training Job, would I? To be sure, I also tried to add pip==23.1.2 at the beginning of the requirements.txt to be sure it is updated also in the training machine, but it seems to not have any effect

0

Some solution found in this issue :

  • Upgrade setuptools.
  • Make sure you have the right python version
  • Install numpy prior to installing other libraries

If the issue persists, this command can change the behaviour of pip install. So to test if that will affect it in any way you can test it by using --use-feature=in-tree-build

AWS
answered a year ago
  • I tried to add it to the requirements.txt file, but it doesn't solve the problem. Instead, in the notebook all of them are updated at the beginning. How can I change the pip install command, adding --use-feature=in-tree-build, in the Training Job? For me, the strange element is that the same code works if outside the folder cloned from git. So this needs to have some correlation.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions