0

I am just starting to learn programming in general and Python specifically. Yesterday I did something by mistake (I don't know what!) on Pycharm and I think I moved python to a new location (and lost all the environments I had in the process). I kept getting the "bad interpreter no such file or directory /usr/bin/python" message.

I tried uninstalling and installing anaconda again and made it work, but the path is different and I cannot access the old environments although I see the data and folders are still there.

I just want to have everything as it was yesterday morning :(

  • when you say "there", where is that? have you tried setting the path in pycharm to that "there" location? – StrangeSorcerer Nov 12 '21 at 13:31
  • 'There' is a directory in my hard drive, basically. I have tried to select that path many times, yes, but it says it is empty. There is no interpreter in that location anymore. – lamujerquefuma Nov 12 '21 at 13:45
  • Welcome to Stack Overflow. Open [a new project](https://www.jetbrains.com/help/pycharm/open-projects.html) with the source code files (Did you move them? Are they still on the disk? Do you have a backup copy?) Afterwards [choose the old interpreter or create a new one](https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html#interpreter) find the files on the disk and remember that virtual environments are not supposed to be moved around. – bad_coder Nov 12 '21 at 13:59
  • Does this answer your question? [PyCharm. /usr/bin/python^M: bad interpreter](https://stackoverflow.com/questions/9975011/pycharm-usr-bin-pythonm-bad-interpreter) – bad_coder Nov 12 '21 at 14:01
  • @bad_coder Thank you :) I did not move anything knowingly (and I actually don't know if I did, maybe I installed something?), I am just still very new and ignorant, so these mistakes unfortunately happen. I haven't lost any code files, it is the python location and its environments that seem to be set differently. I mean, I have made the program work, but I'd like to have it back where it was, and get the envs back. I want to be very careful when moving anything. – lamujerquefuma Nov 12 '21 at 14:25
  • You description doesn't allow to know exactly what went wrong, but if it's just an interpreter/venv problem you should be ready to create new ones quickly. It'll probably be easier than trying to fix a broken environment (when you don't know exactly what's broken with it). – bad_coder Nov 12 '21 at 14:30

0 Answers0