hi, im not a developer i had being building blender in ubuntu following the steps in the wiki https://wiki.blender.org/wiki/Building_Blender/Linux/Ubuntu it was working great so far but today i try to compile, its being a few days since the last time, and i have this error
I was aware that blender was moving on with python version, but i didn’t expect this error, i now realized that i have to update something but im not sure what. .
after going around and googling i found out that apt get has some python libs (i had to google that, im not a developer nor a linux geek) but there is no python 3.10 in the list
¿could someone provide a clue about how to fix it or at least where should i start looking?
im really lost here, my environment are the vertex and the edges.
Thanks
we occasionally update them, it’s recommended to run make update on a regular basis, if it keeps giving you trouble just remove your build folder and it’ll sort it self out.
Couple of things, blender 2.93 shipped with python 3.9, so it asking for 3.10 seems “iffy” are you sure you are building the code you think you are building? The 2.93 tree has the version check on line 839 and checks for 3.9.
As for the version check, usually when we add a check for a minimum version, we use parts of the API that the new python version offers, so it’s quite likely the code really just won’t build against older python versions.
UPDATE: from below. All you need to do it run svn revert --recursive .
in the lib/linux_centos7_x86_64 directory.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I had a similar problem and found it straightforward to compile python3.10 and install it in its own directory for blender to build with.
I’ve posted at python - Unable to build blender - Stack Overflow
but I’ll paste the procedure here as well. It should take less than 10 minutes to get to compiling blender again.
My distro ( Devuan ) doesn’t yet offer python3.10. I compiled and installed it in a custom directory so as not to affect existing python installations.
Expand it in a working directory ( ok to delete later ):
tar -xf Python-3.10.8.tgz
cd Python-3.10.8
now configure python to build with custom paths ( here I’m using ~/blenderpython )
export set BLENDERPYTHONDIR=/home/`whoami`/blenderpython
./configure --enable-optimizations --prefix=$BLENDERPYTHONDIR
make -j 4
make install
Add required packages:
cd $BLENDERPYTHONDIR/bin/;
./pip3 install numpy;
./pip3 install requests;
./pip3 install zstandard;
./pip3 install cython;
./pip3 -vvv list # to see installed and where.
# i.e. all installed in ~/blenderpython/lib/python3.10/site-packages
Now go to your blender source… in home dir?
cd ~/blender-git/blender/
and try building again specifying your new python
BUILD_CMAKE_ARGS=-DPYTHON_EXECUTABLE=$BLENDERPYTHONDIR/bin/python3.10\ -DPYTHON_LIBRARY=$BLENDERPYTHONDIR/lib/libpython3.10.a\ -DPYTHON_INCLUDE_DIR=$BLENDERPYTHONDIR/include/python3.10/ make full
note there are two backslashed spaces in the command above.
note PYTHON_EXECUTABLE and PYTHON_LIBRARY point to files. PYTHON_INCLUDE_DIR points to… a dir.
I’m a little confused what’s going on, why go through all the trouble of building 3.10.8? that is the version we are currently shipping in svn, just grabbing it from our repository would by far have been the easiest way to go about this?
I had wondered… looks like the make update lies to us ( see below).
Now I’ve manually cloned from svn the lib into a new lib2 directory and sure enough I’ve seen python3.10 updates fly by. It’s taking over an hour (not yet done… keeps halting - busy server?).
I tried again to do a “make update” in the blender directory :
The make update does claim: “Updating Precompiled Libraries and Tests”
and proceeds to do an svn cleanup and update of the linux_centos7_x86_64 lib and reports: “At revision 63081”.
I see references to the python info in revision back in revision 63074 but my lib/linux_centos7_x86_64/python is sparsely populated despite being a later revision.
It’s been another 30 min (at least) and I’ve finally got linux_centos7_x86_64 cloned into lib2 and it reports: “Updated to revision 63081.”
Renaming things so the newly cloned lib dir is in place (I’m not doing it again! ) and clearing the CMake cache results in a successful build using the centos python resources.
I’m worn down atm… but will look into a bug report later…
@LazyDodo and @JJones This is just a comment for what’s been happening recently (over the last week or so).
Quite a few people are running make update then make and experiencing some error related to Python not being found. And like JJones experienced, the python directory in the libs folder appears to be missing some files/folders:
I believe LazyDodo has talked about this earlier (on other platforms). The make update process makes use of Python at certain steps. And it doesn’t really like it if the python in the libs folder updates while the make update process is running, and this sometimes results in errors resulting in a broken libraries folder (specifically a broken Python for some people)
I believe this is what JJones is experiencing.
I believe the fix for this is to:
Change directory to the libs folder - cd ~/blender-git/lib/linux_centos7_x86_64
Run svn cleanup to fix the broken libs folder - svn cleanup
Then manually update the libraries - svn update
Or… delete your old libs folder and download it from scratch.
I should note, I compile Blender on macOS, Linux, and Windows. And Linux was the only platform I personally experienced this issue with when the Python libs were updated over the last week or so.
If the issue is the same one I think it is, then there is a way to fix it without delete your old libs folder and re-downloading from scratch. I just can’t remember the exact steps. Sorry about that.
The svn diff reports diffs in the python directories for files that don’t exist in my tree.
The svn revert --recursive . did the trick.
I hadn’t updated/compiled blender for months so it could be a few things in that timeframe if not the timeframe itself?
I see mentions of doing a sparse checkout not allowing updates of files not initially checked out - which in this case would be the newly added python3 files since I last compiled blender? I’m speculating.
Since doing the revert I can delete the python directory and do a simple update again… and it does fetch the python files.
I’'ll keep my bad directory around to test with some more later.
It looks like this is a bug in svn that has vexed many people over the years. The following web pages include Windows, Mac and Linux users experiencing the problem.
The only consistently working solution seems to be to use revert.
revert would make sense for blender’s use here as well would it not?
I modified build_files/utils/make_update.py to use revert instead of update:
I may have jumped the gun on this… but here’s the diff for further review comments changes etc: https://developer.blender.org/D16365
and I’ve taken the liberty of adding LazyDodo and Alaska as subscribers.
Regarding Python creating temporary files in the SVN directory.
We could run Python with PYTHONDONTWRITEBYTECODE=1 when it’s located in Blender SVN directory, or we could have the make update script remove __pycache__, although it is a bit weak to have solutions that only apply to Python.
On the other hand, if Python is the only program in our SVN that is creating temporary files - that may be an acceptable solution.