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

Trouble with cvxpy #117

Open
rukawa917 opened this issue Jul 31, 2021 · 1 comment
Open

Trouble with cvxpy #117

rukawa917 opened this issue Jul 31, 2021 · 1 comment

Comments

@rukawa917
Copy link

rukawa917 commented Jul 31, 2021

I seem to have error in importing cvxpy for some reason.

I have looked for solutions, but I can't find the solution. Below is the error I got.
I am using PyCharm and my OS is Mac.

Traceback (most recent call last):
File "/Users/chriskang/Desktop/OneDrive - HKUST Connect/Pycharm/2021_Toy/DeepDow/data_prep.py", line 5, in
from deepdow.benchmarks import Benchmark, OneOverN, Random
File "/Users/chriskang/Desktop/OneDrive - HKUST Connect/Pycharm/2021_Toy/DeepDow/venv/PycharmProjects/VirtualEnvList/lib/python3.8/site-packages/deepdow/benchmarks.py", line 5, in
from cvxpylayers.torch import CvxpyLayer
File "/Users/chriskang/Desktop/OneDrive - HKUST Connect/Pycharm/2021_Toy/DeepDow/venv/PycharmProjects/VirtualEnvList/lib/python3.8/site-packages/cvxpylayers/torch/init.py", line 1, in
from cvxpylayers.torch.cvxpylayer import CvxpyLayer # noqa: F401
File "/Users/chriskang/Desktop/OneDrive - HKUST Connect/Pycharm/2021_Toy/DeepDow/venv/PycharmProjects/VirtualEnvList/lib/python3.8/site-packages/cvxpylayers/torch/cvxpylayer.py", line 1, in
import diffcp
File "/Users/chriskang/Desktop/OneDrive - HKUST Connect/Pycharm/2021_Toy/DeepDow/venv/PycharmProjects/VirtualEnvList/lib/python3.8/site-packages/diffcp/init.py", line 3, in
from diffcp.cone_program import solve_and_derivative,
File "/Users/chriskang/Desktop/OneDrive - HKUST Connect/Pycharm/2021_Toy/DeepDow/venv/PycharmProjects/VirtualEnvList/lib/python3.8/site-packages/diffcp/cone_program.py", line 3, in
import diffcp.cones as cone_lib
File "/Users/chriskang/Desktop/OneDrive - HKUST Connect/Pycharm/2021_Toy/DeepDow/venv/PycharmProjects/VirtualEnvList/lib/python3.8/site-packages/diffcp/cones.py", line 6, in
from _diffcp import dprojection, project_exp_cone, Cone, ConeType
ImportError: dlopen(/Users/chriskang/Desktop/OneDrive - HKUST Connect/Pycharm/2021_Toy/DeepDow/venv/PycharmProjects/VirtualEnvList/lib/python3.8/site-packages/_diffcp.cpython-38-darwin.so, 2): Library not loaded: @rpath/libc++.1.dylib
Referenced from: /Users/chriskang/Desktop/OneDrive - HKUST Connect/Pycharm/2021_Toy/DeepDow/venv/PycharmProjects/VirtualEnvList/lib/python3.8/site-packages/_diffcp.cpython-38-darwin.so
Reason: image not found

Please help

@jankrepl
Copy link
Owner

jankrepl commented Aug 1, 2021

Hey there!

Looking at the traceback I think this issue has to do with incorrect installation of cvxpylayers and more specifically it's dependency diffcp.

I would image that if you try to run the following import inside of Python you get the same error, right?

import diffcp.cones as cone_lib

Anyway, if that is the case, I would definitely encourage you to read through issues in the following repos. And if none of them addresses your problem you should probably create a new issue.

If you figure out the problem, feel free to close this issue and potential describe what measures you took:)

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