Have you tried using Miniconda or Anaconda?
In a nutshell, it's a good way to test different python versions and you won't have to worry about messing up your system python (projects/installers that make use of the keyword python
).
- After installation, open terminal and initialize conda (if you didn't add it to PATH)
source ~/miniconda3/bin/activate
- Add the channels
intel
and conda-forge
to find packages there: conda config --add channels intel && conda config --add channels conda-forge
- Create a new environment called py38 with python 3.8 and pip
conda create -n py38 python=3.8 pip
- Conda will solve the environment and make sure the packages are compatible. Addressing your initial problem, you can double check the pip version (when I did it, it was
pip-19.3.1-py38_0
- Activate your environment
conda activate py38
- Now when you type
python
while inside this environment, it will use the interpreter you set up. Also, pip install
and conda install
will be directed to your py38
environment until you conda deactivate
or switch.
Here's the output when I ran conda create -n py38 python=3.8 pip
.
Collecting package metadata (current_repodata.json): done Solving
environment: done
Package Plan
environment location: /home/mikkeyboi/miniconda3/envs/py38
added / updated specs:
- pip
- python=3.8
The following packages will be downloaded:
package | build
---------------------------|-----------------
certifi-2019.9.11 | py38_0 147 KB conda-forge
pip-19.3.1 | py38_0 1.9 MB conda-forge
python-3.8.0 | h357f687_3 39.0 MB conda-forge
setuptools-41.6.0 | py38_1 628 KB conda-forge
wheel-0.33.6 | py38_0 35 KB conda-forge
------------------------------------------------------------
Total: 41.7 MB
The following NEW packages will be INSTALLED:
_libgcc_mutex pkgs/main/linux-64::_libgcc_mutex-0.1-main
ca-certificates
conda-forge/linux-64::ca-certificates-2019.9.11-hecc5488_0 certifi
conda-forge/linux-64::certifi-2019.9.11-py38_0 libffi
conda-forge/linux-64::libffi-3.2.1-he1b5a44_1006 libgcc-ng
pkgs/main/linux-64::libgcc-ng-9.1.0-hdf63c60_0 libstdcxx-ng
pkgs/main/linux-64::libstdcxx-ng-9.1.0-hdf63c60_0 ncurses
conda-forge/linux-64::ncurses-6.1-hf484d3e_1002 openssl
conda-forge/linux-64::openssl-1.1.1d-h516909a_0 pip
conda-forge/linux-64::pip-19.3.1-py38_0 python
conda-forge/linux-64::python-3.8.0-h357f687_3 readline
conda-forge/linux-64::readline-8.0-hf8c457e_0 setuptools
conda-forge/linux-64::setuptools-41.6.0-py38_1 sqlite
conda-forge/linux-64::sqlite-3.30.1-hcee41ef_0 tk
conda-forge/linux-64::tk-8.6.9-hed695b0_1003 wheel
conda-forge/linux-64::wheel-0.33.6-py38_0 xz
conda-forge/linux-64::xz-5.2.4-h14c3975_1001 zlib
conda-forge/linux-64::zlib-1.2.11-h516909a_1006
Proceed ([y]/n)? y
Downloading and Extracting Packages python-3.8.0 | 39.0 MB |
############################### | 100% setuptools-41.6.0 | 628 KB | ##################################### | 100% pip-19.3.1
| 1.9 MB | ##################################### | 100%
wheel-0.33.6 | 35 KB |
############################### | 100% certifi-2019.9.11 | 147 KB | ##################################### | 100% Preparing
transaction: done Verifying transaction: done Executing transaction:
done
I also did pip install pyinotify
to address your import inquiry,
python -c "import pyinotify; print(pyinotify.__version__)"
gave me 0.9.6
.