yorik wrote: ↑Fri Jan 04, 2019 1:19 pm
1) ...
So for who has the problem, it would be interesting to know what
App.getResourceDir() + 'Mod/Start/StartPage/' says, and verify if the other scripts (LoadNew.py, LoadMRU.py, etc..) are found at that location.
If everything is correct, maybe we need to use an absolute path instead of a relative...
This is the output:
Code: Select all
App.getResourceDir() + 'Mod/Start/StartPage/'
'D:/FreeCAD_0.18.15536_Conda_Py3QT5-WinVS2015_x64/data/Mod/Start/StartPage/'
When Browsing to this directory the modules are all in place.
Now Syres inspired me a bit. I placed the conda package into the subfolder "D:\My FreeCAD". Can you guess now what happend? Yes it works!
If there is a space in the path the libraries are found, even in another than the C drive. If there isn't a space, the libraries are always searched on the C drive.
@Syres: Can you verify this if you place the conda package in a path without a space, if you then get the error that the phyton scripts cannot be found in C drive?
Yorik, to your second Question:
yorik wrote: ↑Fri Jan 04, 2019 1:19 pm
2) The icons that don't appear are all created by python's tempfile.mkstemp() function. We can test where it creates its temp files foe example by doing this:
Code: Select all
import tempfile
dummyfile = tempfile.mkstemp(dir=tempfolder,suffix='.png')
print(dummyfile)
The file is created:
Code: Select all
import tempfile
dummyfile = tempfile.mkstemp(dir='C:\\Users\\Roger Kuster\\AppData\\Local\\Temp',suffix='.png')
print(dummyfile)
(11, 'C:\\Users\\Roger Kuster\\AppData\\Local\\Temp\\tmp6juwflyv.png')
I have also checked the temp folder. There are subfolders called FreeCADStartThumbnails... which contains the thumbnails that should be displayed on the start page. They are created at the first time the start page is displayed and displayed correctly in an imageviewer, so they aren't corrupt.
- FreeCAD_Thumbnails_temp_folder.PNG (43.66 KiB) Viewed 1965 times
During testing I struggeled with the encoding of the temp string. Normally coded with windows standard syntax I got always an error that
the '\' couldn't be encoded, so I had to use the escape char ('\\'):
Code: Select all
dummyfile = tempfile.mkstemp(dir='C:\Users\Roger Kuster\AppData\Local\Temp',suffix='.png')
File "<input>", line 1
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
Could the thumbnail access code be failing because of this? When I use the normal build (PY2/QT4) the thumbnails are displayed.
Roger