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

How to install nbviewer without futures in Python 3 #1061

Open
manualsh opened this issue Jul 18, 2024 · 0 comments
Open

How to install nbviewer without futures in Python 3 #1061

manualsh opened this issue Jul 18, 2024 · 0 comments

Comments

@manualsh
Copy link

manualsh commented Jul 18, 2024

Hello Team,

The bug

Preliminary investigation showed that:

The error you’re encountering is due to the futures package, which is not compatible with Python 3. The futures package is a backport of the concurrent.futures module from Python 3 to Python 2. Since you’re using Python 3, you don’t need to install the futures package.

Here’s how you can resolve this issue:

Remove futures from your dependencies: If you have futures listed in your requirements.txt or any other dependency file, remove it.

Install nbviewer without futures

Getting an error

To Reproduce
Steps to reproduce the behavior in ubuntu 22.04:

1. sudo apt install libmemcached-dev libcurl4-openssl-dev pandoc libevent-dev

2. mkdir nbviewer
cd nbviewer
python3 -m venv venv
source venv/bin/activate
pip install nbviewer
~/nbviewer$ source venv/bin/activate
(venv) user@LAPTOP:~/nbviewer$ cat /etc/issue
Ubuntu 22.04.4 LTS \n \l

(venv) user@LAPTOP:~/nbviewer$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:        22.04
Codename:       jammy
(venv) user@LAPTOP:~/nbviewer$ pip install nbviewer
Collecting nbviewer
  Using cached nbviewer-1.0.1-py2.py3-none-any.whl (6.1 MB)
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
  ╰─> [25 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 14, in <module>
        File "/home/pavilion/nbviewer/venv/lib/python3.10/site-packages/setuptools/__init__.py", line 18, in <module>
          from setuptools.dist import Distribution
        File "/home/pavilion/nbviewer/venv/lib/python3.10/site-packages/setuptools/dist.py", line 31, in <module>
          from setuptools.extern.more_itertools import unique_everseen
        File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 674, in _load_unlocked
        File "<frozen importlib._bootstrap>", line 571, in module_from_spec
        File "/home/pavilion/nbviewer/venv/lib/python3.10/site-packages/setuptools/extern/__init__.py", line 52, in create_module
          return self.load_module(spec.name)
        File "/home/pavilion/nbviewer/venv/lib/python3.10/site-packages/setuptools/extern/__init__.py", line 37, in load_module
          __import__(extant)
        File "/home/pavilion/nbviewer/venv/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/__init__.py", line 1, in <module>
          from .more import *  # noqa
        File "/home/pavilion/nbviewer/venv/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/more.py", line 5, in <module>
          from concurrent.futures import ThreadPoolExecutor
        File "/tmp/pip-install-7551xdoq/futures_f22cd57a52e14da184788a6873650c59/concurrent/futures/__init__.py", line 8, in <module>
          from concurrent.futures._base import (FIRST_COMPLETED,
        File "/tmp/pip-install-7551xdoq/futures_f22cd57a52e14da184788a6873650c59/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.

I'm able to work with docker nbviewer, but would like to work with the natively installed nbviewer.
Could you please look into this?

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

1 participant