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

pip install -e ./tutor-indigo fails on Ubuntu 22.04LTS #122

Closed
misilot opened this issue Jan 28, 2025 · 8 comments
Closed

pip install -e ./tutor-indigo fails on Ubuntu 22.04LTS #122

misilot opened this issue Jan 28, 2025 · 8 comments

Comments

@misilot
Copy link
Contributor

misilot commented Jan 28, 2025

Installing collected packages: tutor-indigo
  Running setup.py develop for tutor-indigo
    error: subprocess-exited-with-error

    × python setup.py develop did not run successfully.
    │ exit code: 1
    ╰─> [32 lines of output]
        running develop
        /usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
          warnings.warn(
        WARNING: The user site-packages directory is disabled.
        /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
          warnings.warn(
        error: can't create or remove files in install directory

        The following error occurred while trying to add or remove files in the
        installation directory:

            [Errno 13] Permission denied: '/usr/local/lib/python3.10/dist-packages/test-easy-install-242037.write-test'

        The installation directory you specified (via --install-dir, --prefix, or
        the distutils default setting) was:

            /usr/local/lib/python3.10/dist-packages/

        Perhaps your account does not have write access to this directory?  If the
        installation directory is a system-owned directory, you may need to sign in
        as the administrator or "root" account.  If you do not have administrative
        access to this machine, you may wish to choose a different installation
        directory, preferably one that is listed in your PYTHONPATH environment
        variable.

        For information on other options, you may wish to consult the
        documentation at:

          https://setuptools.pypa.io/en/latest/deprecated/easy_install.html

        Please make the appropriate changes for your system and try again.

        [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [32 lines of output]
    running develop
    /usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    WARNING: The user site-packages directory is disabled.
    /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    error: can't create or remove files in install directory

    The following error occurred while trying to add or remove files in the
    installation directory:

        [Errno 13] Permission denied: '/usr/local/lib/python3.10/dist-packages/test-easy-install-242037.write-test'

    The installation directory you specified (via --install-dir, --prefix, or
    the distutils default setting) was:

        /usr/local/lib/python3.10/dist-packages/

    Perhaps your account does not have write access to this directory?  If the
    installation directory is a system-owned directory, you may need to sign in
    as the administrator or "root" account.  If you do not have administrative
    access to this machine, you may wish to choose a different installation
    directory, preferably one that is listed in your PYTHONPATH environment
    variable.

    For information on other options, you may wish to consult the
    documentation at:

      https://setuptools.pypa.io/en/latest/deprecated/easy_install.html

    Please make the appropriate changes for your system and try again.

    [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

From what I can gather it might be related to this issue: pypa/pip#7953

I had to upgrade from Ubuntu 20, since tutor dropped support for Python 3.8. I'm going to try upgrading to Ubuntu 24 to see if it might be fixed there, but wanted to log the issue in case you have any other suggestions.

@misilot
Copy link
Contributor Author

misilot commented Jan 28, 2025

24.04 gives a different error, looks like we might have to do a virtual environment for it.

$ pip install 'tutor[full]>=19.0.0,<20.0.0'
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.12/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.

@DawoudSheraz DawoudSheraz moved this from Pending Triage to Backlog in Tutor project management Jan 29, 2025
@miroirdelame
Copy link

Hello,

I have the same issue, even with a virtualenv. Maybe I've not set the appropriate folder...
What should I do ?

Thanks in advance.

@misilot
Copy link
Contributor Author

misilot commented Feb 7, 2025

What I ended up doing was creating a virtual environment to install

python3 -m venv .venv
source .venv/bin/activate
pip install tutor[full]
pip install -e ./tutor-indigo

@miroirdelame
Copy link

Great, it worked ! I didn't even have to install Indigo, it worked out of the box contrary to my previous installation of tutor from the repository)
Thanks a lot !

@DawoudSheraz
Copy link
Contributor

It does not appear to be Indigo issue. It is related to configuration/setup issues on the machine. The externally-managed-environment, for instance, happens because the python main environment is managed by apt and does not allow pip install to edit the packages. Setting up venv is the go-to-way.
Related thread: https://discuss.openedx.org/t/fresh-ubuntu-install/14974

I will close this issue unless there are any objections/concerns. Thanks

@misilot
Copy link
Contributor Author

misilot commented Feb 11, 2025 via email

@DawoudSheraz
Copy link
Contributor

Yes, the documentation update will be done. See overhangio/tutor#1198

@DawoudSheraz
Copy link
Contributor

Closing this as Tutor official documentation update will be taken care of in overhangio/tutor#1198.

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

No branches or pull requests

3 participants