0

After installing PIP and updating Python to it's latest version, I got an error message about the Path and decided to fix it but it seems that what I did really didn't solve anything about the problem. What is the standard procedure for adding a "Path" for a Python installation? pls help :( This is the error that appears on the startup:

Error found when loading /home/maverick/.profile:

/home/maverick/.profile: line 28: :/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lo cal/games:/snap/bin: No such file or directory

/home/maverick/.profile: line 29: :/home/maverick/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sb in:/bin:/usr/games:/usr/local/games:/snap/bin: No such file or directory

/home/maverick/.profile: line 30: :/home/maverick/.local/bin:/home/maverick/.local/bin:/usr/local/sbin:/usr/local/ bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin: No such file or directory

As a result the session will not be configured correctly. You should fix the problem as soon as feasible.

That's basically the message so I don't really know how to fix or where to start.

Raffa
  • 32,237

1 Answers1

0

After installing PIP

That is most likely not an issue.

and updating Python to it's latest version,

That is a big issue (If you replace the default system Python version) ... You don't do that ... Python should only be updated by your package-manager when you upgrade to a newer Ubuntu release for major version updates and with usual Ubuntu security updates for minor versions.

The reason is (As far as system Python goes) that Ubuntu relies heavily on Python for system functionality and for that the Python version is critical.

I got an error message about the Path and decided to fix it but it seems that what I did really didn't solve anything about the problem.

You need to edit /home/maverick/.profile like so:

nano /home/maverick/.profile

Then comment out(by adding # before them) those lines(number 28,29 and 30) like so:

# :/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lo cal/games:/snap/bin:
# :/home/maverick/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sb in:/bin:/usr/games:/usr/local/games:/snap/bin:
# :/home/maverick/.local/bin:/home/maverick/.local/bin:/usr/local/sbin:/usr/local/ bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:

Then, save the edit to the file by pressing Ctrl + x then press y.

Those lines appear to be remnants of broken old paths strings that were looking something like this:

export PATH="$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lo cal/games:/snap/bin"

Where they were added to the environment variable $PATH and exported with export so that they will be available to other shells other than the parent shell and parsed as multiple search paths separated by colons :.

Now they are broken, your shell interprets them as paths to actual files and directories but with the added : and the whole line as a single path as well.

What is the standard procedure for adding a "Path" for a Python installation?

The PATH environment variable (set as such in a per user session) is essential to the functionality of your userspace applications and is already set to something like this:

$ echo "$PATH"
/home/ubuntu/.local/bin:/home/ubuntu/.local/bin:/home/ubuntu/.local/bin:/home/ubuntu/.local/bin:/home/ubuntu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin

To set it, make sure you preserve the search paths it already has by adding $PATH: at the beginning separating it from the additional paths with a colon : and separating the rest of additional paths by colons as well like so:

export PATH="$PATH:/additional/path/one:/additional/path/two:/additional/path/three"
Raffa
  • 32,237