• Register

Težave z uporabo modula scipy.optimize

0 votes
67 views

Ko želim uporabiti modul scipy.optimize in uvoziti curve_fit, mi Jupyter Notebook javi sledečo napako:

C:\ProgramData\Anaconda3\lib\importlib\_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
  return f(*args, **kwds)
C:\ProgramData\Anaconda3\lib\importlib\_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
  return f(*args, **kwds)
C:\ProgramData\Anaconda3\lib\importlib\_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
  return f(*args, **kwds)
Na vajah mi je asistent povedal naj uporabim naslednji ukaz: !python -m pip install --upgrade numpy scipy
ko ta ukaz uporabim mi Jupyter Notebook javi:
Collecting numpy
  Using cached numpy-1.18.4-cp37-cp37m-win_amd64.whl (12.8 MB)
Requirement already up-to-date: scipy in c:\programdata\anaconda3\lib\site-packages (1.4.1)
Installing collected packages: numpy
  Attempting uninstall: numpy
    Found existing installation: numpy 1.18.1
    Uninstalling numpy-1.18.1:
in kasneje še napako:
ERROR: Error checking for conflicts.
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3021, in _dep_map
    return self.__dep_map
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2815, in __getattr__
    raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3012, in _parsed_pkg_info
    return self._pkg_info
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2815, in __getattr__
    raise AttributeError(attr)
AttributeError: _pkg_info

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_internal\commands\install.py", line 517, in _warn_about_conflicts
    package_set, _dep_info = check_install_conflicts(to_install)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_internal\operations\check.py", line 114, in check_install_conflicts
    package_set, _ = create_package_set_from_installed()
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_internal\operations\check.py", line 53, in create_package_set_from_installed
    package_set[name] = PackageDetails(dist.version, dist.requires())
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2736, in requires
    dm = self._dep_map
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3023, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3032, in _compute_dependencies
    for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3014, in _parsed_pkg_info
    metadata = self.get_metadata(self.PKG_INFO)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 1420, in get_metadata
    value = self._get(path)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 1616, in _get
    with open(path, 'rb') as stream:
FileNotFoundError: [Errno 2] No such file or directory: 'c:\\programdata\\anaconda3\\lib\\site-packages\\pyodbc-4.0.27.dist-info\\METADATA'
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Dostop je zavrnjen: 'c:\\programdata\\anaconda3\\lib\\site-packages\\numpy\\compat\\py3k.py'
Consider using the `--user` option or check the permissions.
Prosil bi za pomoč, da odpravim težavo.
Lp EB
asked May 11 by edibenko (120 points)
Izgleda, da imate težave z inštalacijo Anaconde.

Najprej bi vam svetoval, da zgornji ukaz ("python -m pip install --upgrade numpy scipy") poženete v okaznem oknu z administratorskimi pravicami. To lahko odprete tako, da v Windows Start meniju poiščete "cmd", z desno kliknete na "Command prompt" oziroma "Ukazna vrstica", in izberete "Run as Administrator / Odpri kot administrator".

Če ne bo pomagalo poskusite Anacondo izbrisati in namestite znova. Pri tem bodite pozorni na mesto namestitve - trenutno je to očitno "c:\\programdata\\anaconda", pri čemer imate morda težave s pravico do dostopa - poskusite nametiti v kako drugo mapo.
Hvala za odgovor
Mi je uspelo tako, da sem na novo namestil Anacondo

1 Answer

0 votes
Rešitev je torej ponovna namestitev Anaconde.
answered May 12 by dgorjup (64,590 points)
...