Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip3 error: externally-managed-environment #7811

Closed
Dmole opened this issue Jan 11, 2024 · 5 comments
Closed

pip3 error: externally-managed-environment #7811

Dmole opened this issue Jan 11, 2024 · 5 comments
Assignees

Comments

@Dmole
Copy link
Contributor

Dmole commented Jan 11, 2024

Describe the bug
pip3 error: externally-managed-environment

To Reproduce

  1. Put Debian 12 in a VM
  2. Try https://tribler.readthedocs.io/en/latest/development/development_on_linux.html#debian-ubuntu-mint
  3. Report documentation bug

Expected behavior
Documentation should use one of the options listed in the pip3 error, or Not list Debian as an option.

Desktop (please complete the following information):

  • OS: Debian 12
  • Tribler's version: master

Additional context

pip3 install --upgrade -r tribler/requirements.txt
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

@Dmole
Copy link
Contributor Author

Dmole commented Jan 11, 2024

EG:

apt install python3-full
mkdir tribler_env
python3 -m venv tribler_env 
./tribler_env/bin/pip3 install --upgrade -r tribler/requirements.txt

Only that errors with

ERROR: Could not find a version that satisfies the requirement libtorrent==1.2.19 (from versions: none)
ERROR: No matching distribution found for libtorrent==1.2.19

so get it from github directly.

But then

Building wheels for collected packages: PyQt5-sip
  Building wheel for PyQt5-sip (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for PyQt5-sip (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [18 lines of output]
      running bdist_wheel
      running build
      running build_ext
      building 'PyQt5.sip' extension
      creating build
      creating build/temp.linux-x86_64-cpython-311
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/me/Downloads/tribler_env/include -I/usr/include/python3.11 -c apiversions.c -o build/temp.linux-x86_64-cpython-311/apiversions.o
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/me/Downloads/tribler_env/include -I/usr/include/python3.11 -c array.c -o build/temp.linux-x86_64-cpython-311/array.o
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/me/Downloads/tribler_env/include -I/usr/include/python3.11 -c descriptors.c -o build/temp.linux-x86_64-cpython-311/descriptors.o
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/me/Downloads/tribler_env/include -I/usr/include/python3.11 -c int_convertors.c -o build/temp.linux-x86_64-cpython-311/int_convertors.o
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/me/Downloads/tribler_env/include -I/usr/include/python3.11 -c objmap.c -o build/temp.linux-x86_64-cpython-311/objmap.o
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/me/Downloads/tribler_env/include -I/usr/include/python3.11 -c qtlib.c -o build/temp.linux-x86_64-cpython-311/qtlib.o
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/me/Downloads/tribler_env/include -I/usr/include/python3.11 -c siplib.c -o build/temp.linux-x86_64-cpython-311/siplib.o
      siplib.c: In function ‘sip_api_get_frame’:
      siplib.c:12751:22: error: invalid use of undefined type ‘struct _frame’
      12751 |         frame = frame->f_back;
            |                      ^~
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for PyQt5-sip
Failed to build PyQt5-sip
ERROR: Could not build wheels for PyQt5-sip, which is required to install pyproject.toml-based projects

Any I don't even want the GUI part so I'll leave the QT fix for others.

@Dmole
Copy link
Contributor Author

Dmole commented Jan 11, 2024

Getting libtorrent from github:

apt install libboost-tools-dev libboost-dev libboost-system-dev
wget "https://github.com/arvidn/libtorrent/releases/download/v1.2.19/libtorrent-rasterbar-1.2.19.tar.gz"
tar -xf libtorrent-rasterbar-1.2.19.tar.gz
cd libtorrent-rasterbar-1.2.19
echo "using gcc ;" >>~/user-config.jam
ln -s /usr/lib/x86_64-linux-gnu/libboost_python311.so.1.74.0 /usr/lib/x86_64-linux-gnu/libboost_python311.so
../tribler_env/bin/python3 setup.py build

uses maybe 2GB RAM per CPU.

@Dmole
Copy link
Contributor Author

Dmole commented Jan 12, 2024

After adding async_timeout to requirements-core.txt that worked.

@Dmole
Copy link
Contributor Author

Dmole commented Jan 12, 2024

#7813

@drew2a drew2a added this to the 7.14.0 milestone Feb 5, 2024
@qstokkink
Copy link
Contributor

This should be resolved by the most-recent Tribler GUI rework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants