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

Unable to install mopidy from the Git repo inside a virtualenv #2037

Closed
Steap opened this issue Jan 9, 2022 · 4 comments
Closed

Unable to install mopidy from the Git repo inside a virtualenv #2037

Steap opened this issue Jan 9, 2022 · 4 comments

Comments

@Steap
Copy link

Steap commented Jan 9, 2022

Describe the bug
I am unable to install mopidy from the Git repo inside a virtualenv even though I followed the instructions.

How to reproduce

$ mkdir ~/mopidy-dev
$ source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
$ mkvirtualenv -a ~/mopidy-dev --python $(which python3.9) --system-site-packages mopidy
(mopidy) $ git clone https://github.com/mopidy/mopidy.git
(mopidy) $ cd mopidy
(mopidy) $ pip install --upgrade --editable .
Obtaining file:///home/cyril/mopidy-dev/mopidy
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting Pykka>=2.0.1
  Using cached pykka-3.0.2-py3-none-any.whl (27 kB)
Requirement already satisfied: setuptools in /home/cyril/.virtualenvs/mopidy/lib/python3.9/site-packages (from Mopidy==3.2.0) (44.1.1)
Requirement already satisfied: requests>=2.0 in /home/cyril/.local/lib/python3.9/site-packages (from Mopidy==3.2.0) (2.26.0)
Requirement already satisfied: tornado>=4.4 in /usr/lib/python3/dist-packages (from Mopidy==3.2.0) (6.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3/dist-packages (from requests>=2.0->Mopidy==3.2.0) (1.26.5)
Requirement already satisfied: charset-normalizer~=2.0.0 in /home/cyril/.local/lib/python3.9/site-packages (from requests>=2.0->Mopidy==3.2.0) (2.0.7)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests>=2.0->Mopidy==3.2.0) (2020.6.20)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests>=2.0->Mopidy==3.2.0) (2.10)
Installing collected packages: Pykka, Mopidy
  Running setup.py develop for Mopidy
    ERROR: Command errored out with exit status 1:
     command: /home/cyril/.virtualenvs/mopidy/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/cyril/mopidy-dev/mopidy/setup.py'"'"'; __file__='"'"'/home/cyril/mopidy-dev/mopidy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
         cwd: /home/cyril/mopidy-dev/mopidy/
    Complete output (30 lines):
    running develop
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/cyril/mopidy-dev/mopidy/setup.py", line 3, in <module>
        setup()
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 967, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 985, in run_command
        cmd_obj.ensure_finalized()
      File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 107, in ensure_finalized
        self.finalize_options()
      File "/usr/lib/python3/dist-packages/setuptools/command/develop.py", line 52, in finalize_options
        easy_install.finalize_options(self)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 293, in finalize_options
        self.set_undefined_options(
      File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 287, in set_undefined_options
        src_cmd_obj.ensure_finalized()
      File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 107, in ensure_finalized
        self.finalize_options()
      File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 17, in finalize_options
        self.set_undefined_options('install',('install_layout','install_layout'))
      File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 290, in set_undefined_options
        setattr(self, dst_option, getattr(src_cmd_obj, src_option))
      File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 103, in __getattr__
        raise AttributeError(attr)
    AttributeError: install_layout
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/cyril/.virtualenvs/mopidy/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/cyril/mopidy-dev/mopidy/setup.py'"'"'; __file__='"'"'/home/cyril/mopidy-dev/mopidy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.

I tried upgrading setuptools with:

pip install -U setuptools

Which did not help

Expected behaviour
No error should be returned and "pip install" should be successful.

Environment
Please complete the following information:

  • I am running Debian Sid
  • Not even running Mopidy since I cannot install it
  • The config is not relevant here
  • The output of mopidyctl is not relevant here

Additional context
This works fine on Debian testing and in an Ubuntu 20.04 VM.

@kingosticks
Copy link
Member

@kingosticks
Copy link
Member

The workaround to export SETUPTOOLS_USE_DISTUTILS=stdlib works for me. Don't get me wrong, it's horrible but the bug(s) in pip/setiptools/debian seem to be really old. Not sure why Debian are ignoring it.

@Steap
Copy link
Author

Steap commented Jan 11, 2022

I had never faced this issue before. I can confirm the workaround is working. Thanks for your help and sorry for the noise, I'll close this issue.

@Steap Steap closed this as completed Jan 11, 2022
@kingosticks
Copy link
Member

No, not at all. Certainly worthwhile reporting. I only ran into it myself last night on my newly updated system. I just don't think there's anything sensible we can do here to avoid it. I could add a little note to the docs and I expect as soon as I do that they'll fix it!

kingosticks added a commit that referenced this issue Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants