cvxopt
no está instalado en mi máquina:
C:\Users\antoi\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python3.7.exe C:/Users/antoi/Documents/Programming/ModeloMarkowitz/modeloMarkowitz.py
Traceback (most recent call last):
File "C:/Users/antoi/Documents/Programming/ModeloMarkowitz/modeloMarkowitz.py", line 4, in <module>
import cvxopt as opt
File "C:\Users\antoi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\cvxopt\__init__.py", line 50, in <module>
import cvxopt.base
ImportError: DLL load failed: The specified module could not be found.
Process finished with exit code 1
No hay una respuesta canónica. De acuerdo con esta respuesta necesito instalar "Numpy+mkl". Intenté hacerlo en PyCharm pero me dio el siguiente error:
ERROR: Could not find a version that satisfies the requirement numpy-mkl (from versions: none)
ERROR: No matching distribution found for numpy-mkl
WARNING: You are using pip version 20.0.2; however, version 20.1.1 is available.
You should consider upgrading via the 'C:\Users\antoi\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe -m pip install --upgrade pip' command.
Así que intenté una respuesta para Python2.7 con lo siguiente:
- descargar el archivo
whl
correcto de este sitio web (Elija la versión Python correcta y el archivo 32/64, he tomado el primero ya que tengo un sistema operativo de 64 bits) - abrir una terminal de python en PyCharm
- ve al directorio donde has descargado el archivo "whl", con instrucciones "cd".
Segun los consejos de FJ, verifié que tengo una version de Python en 64bits:
(mod_env) C:\Users\antoi\Documents\Programming\ModeloMarkowitz>python3
Python 3.7.7 (tags/v3.7.7:d7c567b08f, Mar 10 2020, 11:52:54) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
La primera vez que intento descargar la libreria me dice el terminal que necesito anadir cosas en el Path: 'C:\Users\antoi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\Scripts'
Despues lo descargo:
(mod_env) C:\Users\antoi\Documents\Programming\ModeloMarkowitz>pip3 install "numpy-1.18.5+mkl-cp37-cp37m-win_amd64.whl"
Requirement already satisfied: numpy==1.18.5+mkl from file:///C:/Users/antoi/Documents/Programming/ModeloMarkowitz/numpy-1.18.5%2Bmkl-cp37-cp37m-win_amd64.whl in c:\users\antoi\appdata\local\packages\pythonsoftwar
efoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (1.18.5+mkl)
WARNING: You are using pip version 20.0.2; however, version 20.1.1 is available.
You should consider upgrading via the 'C:\Users\antoi\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe -m pip install --upgrade pip' command.
Después de descargar numpy-mkl y añadir algo en el PATH, ejecuto el script y obtengo el siguiente error:
C:\Users\antoi\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python3.7.exe C:/Users/antoi/Documents/Programming/ModeloMarkowitz/modeloMarkowitz.py
Traceback (most recent call last):
File "C:\Users\antoi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\numpy\core\__init__.py", line 24, in <module>
from . import multiarray
File "C:\Users\antoi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\numpy\core\multiarray.py", line 14, in <module>
from . import overrides
File "C:\Users\antoi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\numpy\core\overrides.py", line 7, in <module>
from numpy.core._multiarray_umath import (
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/antoi/Documents/Programming/ModeloMarkowitz/modeloMarkowitz.py", line 1, in <module>
import numpy as np
File "C:\Users\antoi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\numpy\__init__.py", line 142, in <module>
from . import core
File "C:\Users\antoi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\numpy\core\__init__.py", line 50, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.7 from "C:\Users\antoi\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe"
* The NumPy version is: "1.18.5"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: DLL load failed: The specified module could not be found.
Process finished with exit code 1
Aqui esta mi PATH
y PYTHONPATH
:
>>> import os
>>> print("PYTHONPATH:", os.environ.get('PYTHONPATH'))
PYTHONPATH: None
>>> print("PATH:", os.environ.get('PATH'))
PATH: C:\Users\antoi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\numpy\DLLs;C:\Users\antoi\.conda\envs\mod_env;C:\Users\antoi\.conda\en
vs\mod_env\Library\mingw-w64\bin;C:\Users\antoi\.conda\envs\mod_env\Library\usr\bin;C:\Users\antoi\.conda\envs\mod_env\Library\bin;C:\Users\antoi\.conda\envs\mod_env\Scripts;C:\Users\antoi\.conda\envs\mod_env\bin;
C:\ProgramData\Anaconda3\condabin;C:\Programs\geckodriver.exe;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\libnvvp;C:\Program Files (x86)\Gr
aphviz2.38\bin;C:\Python27;C:\Python27\Scripts;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS;C:\Windows\system32;C:\Windo
ws;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management
Engine Components\DAL;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wb
em;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Git\cmd;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Se
rver\150\DTS\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Program Fil
es\Microsoft SQL Server\150\DTS\Binn;C:\sqlite3;C:\Program Files (x86);C:\Program Files\nodejs;C:\ProgramData\chocolatey\bin;C:\ProgramData\Anaconda3\Library\bin;C:\ProgramData\Anaconda3\Scripts;C:\Users\RajaRama\
Anaconda3\Library;C:\Program Files (x86)\Yarn\bin;C:\Program Files\NVIDIA Corporation\Nsight Compute 2019.5.0;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\Google\Cloud SDK\google-cloud
-sdk\bin;C:\Users\antoi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\Scripts;C:\Programs\geckodriver.exe;C:\Users\antoi\AppData\Local\Microsoft\Window
sApps;C:\Program Files\nodejs\node_modules\npm\bin;C:\Users\antoi\AppData\Roaming\npm;C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.3\bin;.;C:\Users\antoi\AppData\Local\Yarn\bin;.
>>>
Hasta que estoy usando PyCharm con Anaconda/conda Python intento configurar un entorno virtual Conda pero obtengo un Non-zero exit code
:
Actualizacion
Intenté de seguir las instrucciones dado por Eli-js, la documentacion official de la bilblioteca cvxopt. Desafortunadamente, aunque la biblioteca parece descargarse, parece que mi pitón3 no puede encontrarla:
(mod_env) C:\Users\antoi\Documents\Programming\ModeloMarkowitz>python3 modeloMarkowitz.py
Traceback (most recent call last):
File "modeloMarkowitz.py", line 4, in <module>
import cvxopt as opt
File "C:\Users\antoi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\cvxopt\__init__.py", line 50, in <module>
import cvxopt.base
ImportError: DLL load failed: The specified module could not be found.
(mod_env) C:\Users\antoi\Documents\Programming\ModeloMarkowitz>pip3 install cvxopt
Requirement already satisfied: cvxopt in c:\users\antoi\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (1.2.5)
Requirement already satisfied: mkl in c:\users\antoi\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from cvxopt) (2019.0)
Requirement already satisfied: intel-openmp in c:\users\antoi\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from mkl->cvxopt) (2019.0)
WARNING: You are using pip version 20.0.2; however, version 20.1.1 is available.
You should consider upgrading via the 'C:\Users\antoi\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe -m pip install --upgrade pip' command.
(mod_env) C:\Users\antoi\Documents\Programming\ModeloMarkowitz>conda install -c conda-forge cvxopt
Collecting package metadata (current_repodata.json): done
Solving environment: done
(mod_env) C:\Users\antoi\Documents\Programming\ModeloMarkowitz>python3 modeloMarkowitz.py
Traceback (most recent call last):
File "modeloMarkowitz.py", line 4, in <module>
import cvxopt as opt
File "C:\Users\antoi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\cvxopt\__init__.py", line 50, in <module>
import cvxopt.base
ImportError: DLL load failed: The specified module could not be found.
pip freeze
desde dentro del entorno virtual, para ver qué modulos tienes instalados?