Open ahmoosavi opened 3 years ago
Hi moosavi-69, "I have already run the following codes in my Pycharm's terminal:
cd C:\Program Files\IBM\ILOG\CPLEX_Studio201\python python setup.py install I have already run the following codes in my Pycharm's terminal:"
I solved this issue on Fedora 33 by taking these steps:-
Activate your virtual environment from the command prompt. then...
cd C:\Program Files\IBM\ILOG\CPLEX_Studio201\cplex\python\VERSION\PLATFORM\ Then I used "pip install ." You should be able to use YOUR python package manager (no sure if it is pip or not) on Windows
This will install the cplex runtime base files in your virtual environment (NOTE: your virtual environment must be activated for this to work)
Hope that helps :)
Hi moosavi-69, "I have already run the following codes in my Pycharm's terminal:
cd C:\Program Files\IBM\ILOG\CPLEX_Studio201\python python setup.py install I have already run the following codes in my Pycharm's terminal:"
I solved this issue on Fedora 33 by taking these steps:-
Activate your virtual environment from the command prompt. then...
cd C:\Program Files\IBM\ILOG\CPLEX_Studio201\cplex\python\VERSION\PLATFORM Then I used "pip install ." You should be able to use YOUR python package manager (no sure if it is pip or not) on Windows
This will install the cplex runtime base files in your virtual environment (NOTE: your virtual environment must be activated for this to work)
Hope that helps :)
Thank you so much for your help. I have already done that. But it was not helpful because I am facing another error. You might kindly see the new error that I am facing on this page.
If you still need any information to be able to help me, please let me know to provide them.
Thanks!
Hi moosavi-69,
I came across that page in my search for a solution too....but it not the solution to your problem. Did you carefully check the path I posted? I does not point to the \python\setup.py file you already executed.
The path I posted points to YOUR_CPLEX_DIR\cplex\python\VERSION_NUMBER\YOUR_PLATFORM\
Once you cd into that directory you can type "pip install ." from inside your virtual environment. (NOTE: Be sure to include the . ) Thats it! Done.
Also, make sure you did not receive the "no cplex wrapper detected" warning when you first ran the cplex installer. If you did receive this warning you may have to re-install from inside your activated virtual environment. This will install a local virtual environment copy of cplex. With that done, you can then cd to the path above and type "pip install ."
Let me know how you go. :)
Hi moosavi-69,
I came across that page in my search for a solution too....but it not the solution to your problem. Did you carefully check the path I posted? I does not point to the \python\setup.py file you already executed.
The path I posted points to YOUR_CPLEX_DIR\cplex\python\VERSION_NUMBER\YOUR_PLATFORM\
Once you cd into that directory you can type "pip install ." from inside your virtual environment. (NOTE: Be sure to include the . ) Thats it! Done.
Also, make sure you did not receive the "no cplex wrapper detected" warning when you first ran the cplex installer. If you did receive this warning you may have to re-install from inside your activated virtual environment. This will install a local virtual environment copy of cplex. With that done, you can then cd to the path above and type "pip install ."
Let me know how you go. :)
Hiii!
Thank you so much for spending your time and helping me. I did what you said as shown in the below image:
However, I am again facing the bellow error :(
ok...I think perhaps you first may have installed Cplex initially from outside your virtual environment. That's fine...but now you have to install another copy INSIDE your environment before running the next script.
Try this:- RUN WINDOWS TERMINAL AND NOT CMD TERMINAL Install "Windows Terminal" from the Micosoft Store (this is a PowerShell Terminal) Run Windows Terminal
CHECK VIRTUAL ENVIRONMENT SITE-PACKAGES FOR CPLEX INSTALLATION cd "C:\Users\xxx\PycharmProjects\pythonProject\venv\lib\site-packages\cplex\ dir (or ls) You should see something like the screenshot below. If you do not, or the cplex directory does not exist in site-packages above, then it needs to be installed there. You can do this by following the steps below.
REMOVE ENVIRONMENT VARIABLES "C:\Program Files\IBM\ILOG\CPLEX_Studio129\cplex\python\3.6\x64_win64" and "C:\Program Files\IBM\ILOG\CPLEX_Studio129\cplex\bin\x64_win64\cplex.exe"
FROM WINDOWS TERMINAL PROMPT cd "C:\Users\xxx\PycharmProjects\pythonProject (Activate your VENV) source venv/bin/activate (venv) cd C:\Program Files\IBM\ILOG\CPLEX_Studio201\python (venv) python setup.py install --home C:\Users\xxx\PycharmProjects\pythonProject\venv\Lib\site-packages\cplex (This command needs to be run from (venv) promtp )
Then, rerun the next script like so:- (venv) cd C:\Program Files\IBM\ILOG\CPLEX_Studio201\cplex\python\3.7\x64_win64\ (venv) pip install . ***(Try to avoid using --ignore-installed -V) and don't forget the dot
If all goes well, Cplex should correct any errors. Let me know how it goes.
ok...I think perhaps you first may have installed Cplex initially from outside your virtual environment. That's fine...but now you have to install another copy INSIDE your environment before running the next script.
Try this:- RUN WINDOWS TERMINAL AND NOT CMD TERMINAL Install "Windows Terminal" from the Micosoft Store (this is a PowerShell Terminal) Run Windows Terminal
REMOVE ENVIRONMENT VARIABLES "C:\Program Files\IBM\ILOG\CPLEX_Studio129\cplex\python\3.6\x64_win64" and "C:\Program Files\IBM\ILOG\CPLEX_Studio129\cplex\bin\x64_win64\cplex.exe"
If all goes well, Cplex should correct any errors. Let me know how it goes.
Thank you again. I did what you said (the first part) and saw a very similar result as your screenshots. Please see my own results below:
Anyway, I tried to go to the second stage and see what happens. Thus, I removed the abovementioned paths from both "user variable" and "system variable." For example, the paths in my "user variable" look like below:
Finally, I run the coded you mentioned in Windows PowerShell as below:
However, I face the same error! Sorry if it is causing inconvenience. Your help is much appreciated. If you do not have time, please ignore this message (I do not want to take your time more than this.)
@moosavi-69
You haven't done what I suggested. What you have done is run the YOUR_CPLEX_DIR\cplex\python\3.7\x64_win64\setup.py script.... (you missed an important step)
If you don't want to follow my suggestions, that's fine, we can do this instead:- As a test case, create a new venv of your choice *(do not delete your existing environment) Once you activated your new (venv) prompt, do this:-** STEPS TO TAKE:- (PLEASE NOTE: There are two different paths shown below for Cplex folders)
I hope this is helpful. :)
PS. If you want, you can create your package.json and package-lock.json files like this:-
@moosavi-69
You haven't done what I suggested. What you have done is run the YOUR_CPLEX_DIR\cplex\python\3.7\x64_win64\setup.py script.... (you missed an important step)
- (venv) python main.py
I hope this is helpful. :)
PS. If you want, you can create your package.json and package-lock.json files like this:-
- (venv) cd
- (venv) pip install
Ohh, I see my mistakes. Sorry for that. I do want to follow your suggestion. Just now, I did your previous suggestion (as shown below), but still the problem exists.
I will do your latest suggestion and will update you about the result. Thanks so much.
@hubuser3976
Holly molly. I just created a new project file and followed your second suggestion. Everything is fine now. I do not know why it was not working with the previous project! Anyway, I am so so much grateful for your time and kind attention. Without your help, I could not resolve this problem.
@moosavi-69
Welcome
Hello,
I have coded a mathematical model and want to solve it using DOCPLEX module. My interpreter is Python 3.7. However, after doing a lot of effort, I will face the following error:
I have already run the following codes in my Pycharm's terminal:
or
Finally, I also set the path variables of my own username to something like below: