-
Notifications
You must be signed in to change notification settings - Fork 476
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
Import Error: randn from scripy #412
Comments
Can confirm this error on Python 3.9/10/11 in the official Python containers (https://hub.docker.com/_/python). "pip install scipy<1.12.0" seems to be a viable hot fix. |
It turns out the |
I meet the same problem. Is it fixed? |
I am currently having the same problem, and currently, I confirm that @kingjin94 's proposed hot fix (scipy<1.12.0) work. But a proper fix would be greatly appreciated! |
Go to roboticstoolbox/mobile/EKF.py and change that randn is imported from numpy and remove it from scipy import. Use: from numpy.random import randn |
site-packages/roboticstoolbox/mobile/EKF.py:from collections import namedtuple
import numpy as np
from math import pi
from scipy import integrate
from scipy.linalg import sqrtm, block_diag
from scipy.stats.distributions import chi2
import matplotlib.pyplot as plt
from matplotlib import animation
from spatialmath.base.animate import Animate
from spatialmath import base, SE2
from roboticstoolbox.mobile import VehicleBase
from roboticstoolbox.mobile.landmarkmap import LandmarkMap
from roboticstoolbox.mobile.sensors import SensorBase
# Use numpy's randn instead of scipy's
from numpy.random import randn |
|
Describe the bug
ImportError: cannot import name 'randn' from 'scipy'
Version information
installed from pip 23.2.1
To Reproduce
Steps to reproduce the behavior:
OUTPUT:
Exception has occurred: ImportError
cannot import name 'randn' from 'scipy' (C:\Users\Nicholas Snyder\AppData\Local\Programs\Python\Python312\Lib\site-packages\scipy_init_.py)
File "C:\Users\Nicholas Snyder\Downloads\RVC3-python-main\test.py", line 2, in
from roboticstoolbox import *
ImportError: cannot import name 'randn' from 'scipy' (C:\Users\Nicholas Snyder\AppData\Local\Programs\Python\Python312\Lib\site-packages\scipy_init_.py)
Expected behavior
Expected toolbox to successfully import.
Screenshots
Environment
Additional context
The only thing I was able to find on this issue is that scipy does not have a random module to import anymore. A proposed alternative is to use random from numpy. However, I am not sure if this is the actual underlying issue.
The text was updated successfully, but these errors were encountered: