New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using time.perf_counter module #3
Using time.perf_counter module #3
Conversation
Updated the code to be compliant with Python 3.3+ distributions, in which the time.clock module is deprecated and replaced by time.perf_counter. To minimize the modifications, I imported the perf_counter module and locally named it as clock. With this approach, the rest of the code is untouched.
Updated the code to be compliant with Python 3.3+ distributions, in which the time.clock module is deprecated and replaced by time.perf_counter. To minimize the modifications, I imported the perf_counter module and locally named it as clock. With this approach, the rest of the code is untouched.
I also got the same error that powderblue did. |
Hi, Edit: In order to compile this on your own, you need under windows Visual studio 2017 community edition (2019 should work as well) and a version of Python 3.7.x. You need also to install Cython via "pip install cython". Then you just need to invoke "python make_release.py" and a zip according to your OS should be made, after compiling core.pyx. |
Hey scorpion81, |
Just install the latest release as usual (with the zip file). |
I installed your re-compile, and it enables correctly! |
Hi scorpion81, and Sir CommanderLouiz Sir! :D |
Hi scorpion81! I tried installing the addon 1.1.2 (both Versions, Python 3.7 and 3.8) on my Ubuntu 20.04. But I cannot activate the addon and got the same error like powderblue042. I asked in this question about it. Maybe you could give me some advise what I should try? https://blender.stackexchange.com/q/208134/114757 |
I have rebuilt molecular against Python 3.7 on my local linux machine. It uses blender's bundled statically linked python executable. If make_release.py (and hence cython) is called from this, the resulting .so module from molecular will not depend on libpython3.7m.so.1.0 any more. Seems the build setup here in Github actions relies on python using its own shared library instead a static one. And in case you need to use a different python version for a blender version bundled with a linux distro, you just need to build molecular against that particular python version. |
@scorpion81 |
Hello, I was trying to install this fantastic add-on on the new blender 2.90 version (for Linux) but, when trying to enable it, I got stuck with this error:
As the first try, I downloaded the Blender 2.83.7 LTS version (for Linux), but the error was the same.
Then, I tried to clone this Molecular Script repository and compile myself using the
make_release.py
file but always received the same error during the add-on enable.So I tried to investigate a bit more and found a similar error on other Python-based repositories (not related to Blender), in which I found the possible cause.
In fact, according to Python 3.8 documentation:
I verified my Python installation and it is the 3.8.5 version, this may be the source of the problem. I didn't want to downgrade, so I started to modify the code to try to solve the issue. I wanted to modify as few parts as possible to keep the main code untouched, so I just replaced all the lines importing
time.clock
with lines importing the newtime.perf_counter
using the old "clock" name.In other words, I did the following substitution:
from time import clock
->from time import perf_counter as clock
In this way, all the original calls to the
clock
function actually turn to be a call to the newperf_counter
function. After compiling, installing and enabling, the add-on works like a charm!Is it safe to do a merge in the master branch? Since the
clock
module has been removed, this problem might be more frequent in the future. However, I don't know what is the impact on older versions of Blender and/or Python.