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

[Bug]: Unable to pip install on python 3.10 #152

Open
1 task done
MrTanoshii opened this issue Oct 3, 2022 · 5 comments
Open
1 task done

[Bug]: Unable to pip install on python 3.10 #152

MrTanoshii opened this issue Oct 3, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@MrTanoshii
Copy link
Member

What happened?

Version: 5.0.9
Operating System: Windows

Steps:

  1. Setup venv
  2. pip install honeybot

Expected behavior:

Installation completes without error.

Additional information:

I tried the recommendation from https://stackoverflow.com/questions/54338270/syntax-error-after-installing-futures-package-in-my-virtualenv and downgraded my setuptools to 45.2.0 and it worked.

Screenshot:

WindowsTerminal_pM1mWBff3f

Relevant log output

Collecting colorama
  Using cached colorama-0.4.5-py2.py3-none-any.whl (16 kB)
Collecting futures
  Using cached futures-3.0.5.tar.gz (25 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [27 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 14, in <module>
        File "C:\Users\USERNAME\DIRECTORY\honeybot\venv\lib\site-packages\setuptools\__init__.py", line 247, in <module>
          monkey.patch_all()
        File "C:\Users\USERNAME\DIRECTORY\honeybot\venv\lib\site-packages\setuptools\monkey.py", line 99, in patch_all
          patch_for_msvc_specialized_compiler()
        File "C:\Users\USERNAME\DIRECTORY\honeybot\venv\lib\site-packages\setuptools\monkey.py", line 159, in patch_for_msvc_specialized_compiler
          patch_func(*msvc14('_get_vc_env'))
        File "C:\Users\USERNAME\DIRECTORY\honeybot\venv\lib\site-packages\setuptools\monkey.py", line 149, in patch_params
          mod = import_module(mod_name)
        File "C:\Python310\lib\importlib\__init__.py", line 126, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
        File "C:\Users\USERNAME\DIRECTORY\honeybot\venv\lib\site-packages\setuptools\_distutils\_msvccompiler.py", line 20, in <module>
          import unittest.mock as mock
        File "C:\Python310\lib\unittest\mock.py", line 26, in <module>
          import asyncio
        File "C:\Python310\lib\asyncio\__init__.py", line 8, in <module>
          from .base_events import *
        File "C:\Python310\lib\asyncio\base_events.py", line 18, in <module>
          import concurrent.futures
        File "C:\Users\USERNAME\AppData\Local\Temp\pip-install-8l60h8r4\futures_c2a719274b2049b68e4ac623293c0808\concurrent\futures\__init__.py", line 8, in <module>
          from concurrent.futures._base import (FIRST_COMPLETED,
        File "C:\Users\USERNAME\AppData\Local\Temp\pip-install-8l60h8r4\futures_c2a719274b2049b68e4ac623293c0808\concurrent\futures\_base.py", line 357
          raise type(self._exception), self._exception, self._traceback
                                     ^
      SyntaxError: invalid syntax
      [end of output]

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

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@MrTanoshii MrTanoshii added bug Something isn't working hacktoberfest labels Oct 3, 2022
@ogabrielluiz
Copy link
Contributor

Hi! I think I can take this one.

Is pip install 'futures<3.0.0' required in the build.yml file?

It seems this might be the cause of the problem. From what I've read futures shouldn't be installed with Python 3.

@MrTanoshii
Copy link
Member Author

To be completely honest, I'm not sure where the requirements are being kept for the honeybot core
The only reference to futures I have found so far is in

pip install 'futures<3.0.0'

Yes that is correct, I too understand that futures is now part of the standard library in python3+
I wonder if there is a way to retain backwards compatibility whilst not forcing "hacks" such as the setuptools downgrade mentioned above

@ogabrielluiz
Copy link
Contributor

From what I could see locally and in your log output, the problem lies in that futures is installed by some other dependency and gets the first version that works: 3.0.5.

I ran the GitHub workflow locally too and it works. It probably does so because of the pip install futures<3.0.0 command.

One thing to mention is that in spite of the errors, the installation completes.

@ogabrielluiz
Copy link
Contributor

it is python dependency error, downgrade the version of python to 3.8 or 3.7 and check again

If I understood it correctly, the objective is to be able to install in 3.10 without errors.

@paulosgf
Copy link
Collaborator

paulosgf commented Oct 4, 2022

I guess so too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants