Score:0

Error message on the startup after installing PIP and updating Python

gq flag

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.

us flag
How did you install Python and PIP? Replacing the system python may destroy Ubuntu
Janne Jokitalo avatar
ng flag
Also it would help resolving the issue if you posted the error message.
Mat RICARDO avatar
gq flag
I'll try to take a picture of it, because it appears in a windows on startup not in the moment of execution of a code.
us flag
Don't change the default python version. Instead, use a virtual environment. If you change the default python version, many system apps will not work, and you will have to reinstall Ubuntu
Score:0
jp flag

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"
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.