Unable to upgrade past 3.6.9

OK! sudo apt build-dep python3 seemed to work this time!

No errors with ./configure , waiting for make to finish…

I assume I can delete the ~/Python3.13.0 folder after doing sudo make altinstall?

OK, not sure if these are (important) errors, but after the makefile it said:


The following modules are *disabled* in configure script:
_sqlite3                                                                   

The necessary bits to build these optional modules were not found:
_bz2                      _ctypes                   _ctypes_test           
_curses                   _curses_panel             _dbm                   
_gdbm                     _hashlib                  _lzma                  
_ssl                      _tkinter                  _uuid                  
readline                  zlib                                             
To find the necessary bits, look in configure.ac and config.log.

Could not build the ssl module!
Python requires a OpenSSL 1.1.1 or newer

Checked 112 modules (33 built-in, 63 shared, 1 n/a on linux-x86_64, 1 disabled, 14 missing, 0 failed on import)

I’ll wait for your reply before moving forward (sudo make altinstall), maybe tomorrow… THANKS AGAIN!

No problems! And no, I just went to the URL from your sources.list file - it’s not always possible to browse those servers, but a lot of them do permit directory listings, and it does make this sort of diagnosis much easier.

You CAN, but you may want to hang onto it so you know where things came from. But if disk space is at a premium, sure, delete it (and write yourself a note somewhere about what you did).

Not a problem; just means you can’t use SQLite3 databases. Or if that is a problem to you, apt install libsqlite3-dev should get what you need, and then you can start over from ./configure and it should find it. Though since it’s saying that it’s disabled, you might have to explicitly enable it.

Whether or not these are a problem depends on whether you expect to need them. Actually, you MAY be able to fetch a bunch more libraries by using apt build-dep python3-full - I’m not sure how GalliumOS is set up, but it’s possible that there’s a minimal python3 and then the rest is in separate packages. You can either pick and choose, or try to grab them all; up to you. In any case, you’re welcome to carry on, and come back to this later - those modules will be missing, but the rest of Python will be there.

Now, this one may be a little trickier. Newer versions of Python are built against newer versions of OpenSSL, and it’s entirely possible that the old Bionic repositories won’t have a sufficiently-new OpenSSL for you to use. So you may be stuck without SSL support, which would be a bit of a pain. Try apt policy libssl-dev to see what version(s) are available. You might be lucky, you might not.

No probs, happy to help. You can go ahead and run the installer; all the remaining issues are less significant, and you can wheel back around to try again at any time (install some more dev packages, rerun configure, make, install). Glad it’s working!

1 Like

I was unable to complete this task until now. I ran sudo make altinstall, and it seemed to work but with error. The final error was Makefile:2278: recipe for target 'altinstall' failed

However, python3.13 exists, and it runs the scripts that had an error before (eg. using match-case). I haven’t created an alias for this yet (and I might not), but I have directed my IDE to use this version of Python.

Thanks for all your help! Your explanation and steps were clear and it worked! :slight_smile:

1 Like

Hmm, that looks like the sort of error that summarizes errors that have already happened, so you’d need to scroll up and try to find out what actually went wrong. But it sounds like, whatever it was, it wasn’t too serious.

Glad it worked! Happy to help.

I doubt you are still checking this question/thread, but I have a related problem (I think). As I stated previously, it all seemed to work (I have been using 3.13.0 without problems), and I even aliased it to ‘python’.

HOWEVER, pip is now not working correctly. I was able to install (and use) ‘black’ using pip. BUT, I was trying to install the emoji package and it didn’t work (pip install emoji, and I even tried to specify a specific version, and try using sudo). I even tried to update pip (using pip install --upgrade pip) and I had the same (set of) error.

pip -V says the pip version is 21.3.1 and is linked to python3.6!!! (not 3.13.0) How can I fix this? Do I need to link pip to 3.13.0 (or something like that)? It seems that 3.6 is the ‘default’, even though I have installed 3.13.0 (as per your excellent instructions). What can I do?!? Frustrating…

Use python -m pip install ..., this is guaranteed to use the correct pip, if it’s installed.

Don’t use aliases to solve path-lookup problems. You just end up running a version of Python you didn’t intend to run because you forgot you defined the alias.

The pip executable uses some path that is independent of whatever alias you defined, so even though when you type python at the command line and you get Python, pip is still running the version of Python you are trying to avoid.

In general, only run the executable pip if it’s in a virtual environment where it is explicitly linked to the version of Python also in the virtual environment. Otherwise, use python -m pip so that you know which version of Python executes the module pip.

1 Like

I’m sorry, but I don’t understand what this means. ‘Virtual environment’? do you mean a VM? Why would I need to run a VM when I am running a native version of linux.

Why not use an alias? It already is used to point to python2, all I did was change it to point to python3.13 (my preferred version). Python3 points to python3.6 (this was default for the system). If default and using symbolic links, why are you suggesting that I NOT use them?

Note that the three versions of python are stored in:

/usr/bin/python2.7
/usr/bin/python2 (symbolic link that points to python2.7)
/usr/bin/python3.6
/usr/bin/python3 (symbolic link that points to python3.6)
/usr/local/bin/python3.13
/usr/bin/python (symbolic link that points to /usr/local/bin/python3.13)

FYI, pip is stored in: /home/garth/.local/bin/pip

The installation of 3.13 was using instructions from this forum. Any other installation broke my system, and was very frustrating to fix (or had to reinstall the entire OS).

I have changed the ‘version’ of python I am trying to use with PIP, but each time it gives different results. I will focus on python3.

As noted before, pip --version give me pip 21.3.1 from /home/garth/.local/lib/python3.6/site-packages/pip (python 3.6), so PIP is ‘linked’ to python3.6.

But, I can’t install PIP to the version of python I prefer (3.13). using the command pip3 doesn’t work either (a ton of errors).

I demonstrate the issue, I installed a package using PIP: pip install pyfiglet==0.7
This ‘worked’ but it only worked for python3 / python3.6 since PIP is associated with 3.6 (above).

Using PIP3 didn’t change anything:

Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pyfiglet==0.7 in ./.local/lib/python3.6/site-packages (0.7)

Doing these commands using sudo resulted in whole bunch of errors.

To clarify, pip isn’t ‘working’ for python3.13, regardless of how I call it (directly or via symbolic link). That is, I don’t think any installed packages (using pip) work with 3.13 (probably because it is installed elsewhere than 3.6?) THAT is what I need help with!

FYI, when running a script (which uses the pyfiglet package), it runs differently (or rather, has different errors) depending on the version of python I am using (3.6, 3.13). Script below:

from pyfiglet import Figlet

f = Figlet(font='slant')
print f.renderText('text to render')

python3.6 (or symbolic link python3):

  File "pyfiglet.py", line 7
    print f.renderText('text to render')
          ^
SyntaxError: invalid syntax

python3.13 (or symbolic link python):

  File "/home/garth/Code/Python/CS50/CS50P/pyfiglet.py", line 7
    print f.renderText('text to render')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

(FYI, these error messages are in red and purple, not plain white text)

From these errors, does a) each version see pip? b) why these error messages (esp. since I got that code snippet directly from the pyfiglet page)?

No, I mean a virtual environment (such as created by python -m venv). It’s a way to provide a Python executable with an isolated library.

I use this, but it doesn’t work. pip is associated with python3.6 and not python3.13.

I don’t know how to do this. OK, I will have to research this. I have never used one.

Would I have to reinstall the libraries? How does pip work with vinv?

Then python is associated to 3.6. Maybe you need to activate your virtual environment?

Thanks for the reply.

I’m not sure if I mentioned this before, but I “don’t” want to use a virtual environment. Actually, I don’t know how (or why) to do that. I haven’t use one before (or needed to) and I have never seen this as a ‘step’ when programming in Python (books, tutorials, etc.)

Is it really necessary? Shouldn’t there be a fix here without this step (otherwise, why wouldn’t it be a ‘regular’ step in books/tutorials/etc)?

When you have one installation of Python, the command python will refer to that. The pip command will also refer to that. If you have more than one python installation, the python and pip commands maybe out of sync. Also, sometimes you want to develop python programs with different dependencies; a virtual environment is ideal to isolate independent projects.

1 Like