-1

I am trying to generate a python(.egg) file of cvxpy and import it. Used the below to generate the .egg file for https://github.com/cvxgrp/cvxpy:

python setup.py bdist_egg

While trying to import cvxpy I am getting the below error,

    <>/cvxpy-1.0.8-py2.7-macosx-10.12-x86_64.egg/cvxpy/__init__.py in <module>()
     16 
     17 __version__ = "1.0.8"
---> 18 from cvxpy.atoms import *
     19 from cvxpy.constraints import NonPos, Zero, SOC, PSD
     20 from cvxpy.expressions.variable import Variable

    <>/cvxpy-1.0.8-py2.7-macosx-10.12-x86_64.egg/cvxpy/atoms/__init__.py in <module>()

    <>/cvxpy-1.0.8-py2.7-macosx-10.12-x86_64.egg/cvxpy/atoms/geo_mean.py in <module>()

    <>/cvxpy-1.0.8-py2.7-macosx-10.12-x86_64.egg/cvxpy/atoms/atom.py in <module>()

    <>/cvxpy-1.0.8-py2.7-macosx-10.12-x86_64.egg/cvxpy/expressions/constants/__init__.py in <module>()

    <>/cvxpy-1.0.8-py2.7-macosx-10.12-x86_64.egg/cvxpy/expressions/constants/constant.py in <module>()

    ImportError: No module named fastcache

I am new to python, any pointers / refernces to fix this is really appreciated.

1 Answers1

0

Have you installed ‘CVXPY’ properly and tested it using ‘nose’?

Following is an excerpt from cvxpy page https://www.cvxpy.org/install/index.html:

Install Anaconda.

Install cvxpy with conda.

conda install -c conda-forge lapack
conda install -c cvxgrp cvxpy

Test the installation with nose.

conda install nose
nosetests cvxpy
U3.1415926
  • 812
  • 12
  • 30
  • I am trying to build an .egg file for this package and import it in a notebook. Using Anacoda I was able to use it through command line but I am looking for an .egg file. I used the https://github.com/cvxgrp/cvxpy and "python setup.py bdist_egg" which is failing with above mentioned error. How can I fix it ? – Shadow_returns Sep 24 '18 at 05:48
  • Can you check which version of your python the notebook is using? – U3.1415926 Sep 24 '18 at 07:23