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

ImportError: cannot import name 'comb' from 'scipy.misc' #5

Open
mardub1635 opened this issue Nov 17, 2022 · 1 comment
Open

ImportError: cannot import name 'comb' from 'scipy.misc' #5

mardub1635 opened this issue Nov 17, 2022 · 1 comment

Comments

@mardub1635
Copy link

mardub1635 commented Nov 17, 2022

Importation error. Here are the command entered:

marie@marie-macbookpro121: $ python3 -m venv env
marie@marie-macbookpro121: $ . env/bin/activate
(env) marie@marie-macbookpro121: $ pip install -r requirements.txt 
(env) marie@marie-macbookpro121: $  pip install -r requirements.txt 
(env) marie@marie-macbookpro121: $ textplot generate ../ga_i_fotspar.txt removeme.txt
Traceback (most recent call last):
  File "/home/marie/Documents/billing/textplot/env/bin/textplot", line 4, in <module>
    __import__('pkg_resources').run_script('textplot==0.1.1', 'textplot')
  File "/home/marie/Documents/billing/textplot/env/lib/python3.9/site-packages/pkg_resources/__init__.py", line 666, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/marie/Documents/billing/textplot/env/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1469, in run_script
    exec(script_code, namespace, namespace)
  File "/home/marie/Documents/billing/textplot/env/lib/python3.9/site-packages/textplot-0.1.1-py3.9.egg/EGG-INFO/scripts/textplot", line 6, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/home/marie/Documents/billing/textplot/env/lib/python3.9/site-packages/textplot-0.1.1-py3.9.egg/textplot/helpers.py", line 7, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/home/marie/Documents/billing/textplot/env/lib/python3.9/site-packages/textplot-0.1.1-py3.9.egg/textplot/matrix.py", line 8, in <module>
ImportError: cannot import name 'comb' from 'scipy.misc' (/home/marie/Documents/billing/textplot/env/lib/python3.9/site-packages/scipy/misc/__init__.py)
@simon-20
Copy link

This error occurs because the author did not fix the versions of the dependences used in requirements.txt to those which were current when textplot was written. As such, when installing, the latest version of each module is installed, and since scipy has been updated with breaking API-changes--specifically, the comb module has been moved to scipy.special location--textplot now fails to run out of the box.

As of July 2023, and perhaps surprisingly, this is the only dependency which has broken, and it can be easily fixed by changing line 8 of matrix.py to from scipy.special import comb.

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