os.path.join returning Errno22 in Enthought/Python
I'm working with a fairly complex Enthought/Python program that is returning this error:
File "C:\Users\riddle\Desktop\FCI2\src\equation.py", line 41, in main
fci_data = np.load(os.path.join(local_data_path, "fci_data.npy"))
File "C:\Python27\lib\site-packages\numpy\lib\npyio.py", line 329, in load
fid = open(file, "rb")
IOError: [Errno 22开发者_如何学C] invalid mode ('rb') or filename: 'C:\\Users\white\\Desktop\
\FCI2New\\data\\fci_data.npy'
With respect to this:
fci_data = np.load(os.path.join(local_data_path, "fci_data.npy"))
fci_data = fci_data.replace("'\\','/'")
The additional slashes are particularly puzzling me. local_data_path is global and is defined like so:
local_data_path = static.base_data_path
base_data_path = "C:\Documents and Settings\white\Desktop\FCI2New\data" (from the static module)
Anyone have an idea what might be the issue here? 'rb' should be the correct mode for fci_data. Please forgive any errors or obvious questions, I'm a beginner.
Anne
try first to normalize the path :
local_data_path = os.path.normpath(local_data_path)
精彩评论