os.getwd() returns error from embedded python code in c++ #3917
Unanswered
azzeddinetiba
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I have a code that uses an embedded python code called from c++ :
with CMakeLists.txt :
Now this works perfectly in Ubuntu 20. In Windows 10, (With Python 3.8 from anaconda3, and Viual studio 2019 to compile c++ code) the code works when I :
PYTHONHOME='anacondadir/'
link_directories("anacondadir/libs")
to avoid the error[LINK : fatal error LNK1104: cannot open file 'python38.lib' with CMake finding library]
Now with CMakeLists.txt :
Now the problem is: Apparently (When I run the executable I only get a window with "Abort() has been called" so I can't figure out exactly the error message) I can't do
np.load("../References/discrete/train_data_disp.npy")
. After digging I found thatreturns an error and
sys.executable
is empty .So I have to add
for the code to work. Why do I get this ? and why is it only on Windows ?
Thank you !
Beta Was this translation helpful? Give feedback.
All reactions