pyleecan
pyleecan copied to clipboard
Installation of Pyleecan
Hello,
I am an e-motor designer and would like to test and potentially contribute to Pyleecan, I've done quite some scripting for geometry and winding configuration in the past on different motor topologies. However I am totally new to Python, that scripting work was done in Visual Basic for commercial software (MagNet and Maxwell) and I am stuck at the very first step, how to install Pyleecan.
I downloaded the zip file and installed Python 3.7, then I cannot figure out what to do next. I used the string "pip install -r requirements.txt" in the python command window but get a "Syntax error: invalid syntax" message, pointing to the second "L" of the word "install". The same error message appears when using the string "pip install pre-commit"...
Can you help me solve this issues and getting started, please?
Hi & welcome! Those commands are meant to be executed from the terminal, not from inside the python REPL / command window. Sounds like that’s the first hurdle. What OS are you on?
Hi and thanks for the prompt reply. I am working on the usual Windows 7
Hello & welcome,
On windows you can search for "cmd" that should open the following terminal:
The command "pip install -r requirements.txt" should work in this one.
Once everything installed, you will need to add the pyleecan folder to your Python Path to be able to import/use it. You can do that for instance directly in your python script: https://stackoverflow.com/questions/16114391/adding-directory-to-sys-path-pythonpath/16114586
We are currently working on the first official release for pyleecan to simplify the installation process but we have no release date yet.
Best regards, Pierre
Hello,
The first release of pyleecan is now available, you can install pyleecan directly with the command python -m pip install pyleecan in the cmd.
To be able to call python from the cmd, the folder that contains your python.exe must be in your path, you can follow this tutorial to add it.
Best regards, Cédric
Hello,
Did you managed to install pyleecan or do you need any further help ?
Best regards, Pierre
The problem i'm facing with installing Pyleecan is when i execute "pip install -r requirements.txt" i get an error that there is no matching distribution found for vtk. I am quite certain this just means that vtk is either updated and the version in the requirements is no longer supported. Still i don't know how to fix the problem.
I have some other issues, but i'll make a seperate issue for those.
Hello MVreemann,
since there is no vtk in the requirements directly, it may be due to dependencies, maybe with meshio or pyvista. You could try to install them on your own and see if there is the same error.
Best regards, Sebastian
Hello all,
We just released a new version of pyleecan. I managed to install pyleecan from pip without any problem. Is there anything to solve for this issue or can we close it ?
Best regards, Pierre
I have tried multiple times to start Pyleecan and it did not work:
I installed everything..
Then, I watched this webinar:> https://www.pyleecan.org/webinar_1.html ... it don't show how to start the pyleecan .. the lecturer skipped the most important part which is (run -m pyleecan)
I searched pyleecan folder and I paste it in the python working folder ... nothing worked
I gave up
Hello kamelazeb,
you shouldn't give up yet :-) How do you try to start pyleecan and if there is some error message, what does it tell?
Best regards, Sebastian
Hi Sebastian,
I remember it says 'run' command isn't recognized or something like that.
Okay, so if you installed pyleecan with pip then you should be able to run 'python -m pyleecan' from your terminal.
SebGue
but the guide [https://www.pyleecan.org/get.pyleecan.html] is saying we have to enter this command "run -m pyleecan" not 'python -m pyleecan'... Am I missing something?
Just give it a try.
Hello,
Indeed we need to update the tutorial:
- "run -m pyleecan" is a command for the notebook (used in the tutorial)
- "python -m pyleecan" is for the command line.
I will try to take some time to update the corresponding files.
Best regards, Pierre
Hello,
I tried to install pyleecan using all the methods explained before.
- First, directly in cmd using python -m pyleecan
- Second, I use PyCharm, so I installed packeges there, but, the error I get on both methods is: "INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking".
- I even downloaded anaconda and tried to install it in Jupyter terminal and I got this message: "ERROR: Could not find a version that satisfies the requirement vtk (from pyvista>=0.25.3->pyleecan) (from versions: none) ERROR: No matching distribution found for vtk (from pyvista>=0.25.3->pyleecan)" I downloaded the pip and put it in the Python folder and then "run -m pyleecan" and it does recognize the program.
Am I doing something wrong?
Best Regards, Teodora
Hello,
Thank you for your interest in pyleecan. Which version of python are you using (We recommend >=3.6)? Normally you need to run "pip install pyleecan" before being able to call "python -m pyleecan" Can you also check your pip version ? I heard that they were some issues with pip new backtracking feature so you may need to revert your pip version. If pyvista is an issue, this package shouldn't be mandatory (as long a you don't go in depth with Mesh manipulation) so you can skip its installation.
Best regards, Pierre
Hello,
I have the latest version of Python (3.9), but I tried on 3.8 too. My pip version was 20.03 on the first try and then I updated it to 21.0.1. What version are you using? Maybe that is an issue for me.
Thank you, Teodora
Hello,
On my side I'm using python 3.8.6 and pip 20.2.1
Can you try installing the requirements directly to check what is going on ? The file is available at: https://github.com/Eomys/pyleecan/blob/master/requirements.txt
The corresponding command is:
pip install -r path/to/requirements.txt
Best regards, Pierre
Hello, I run the command 'python -m pip install pyleecan' in cmd windows several times and install by the pycharm, it always stuck in this package 'importlib_metadata-0.12-py2.py3-none-any.whl'(the message say: pip try all the other version of this package and can not find the match, this version 0.12 is the last version limited by the dependency), my python version is 3.9, 32bit. I just want report this bug and I will try install pyleecan without the help of pip.
Hello,
I don't know if this is related to your issue, but had also some installation issue with python 32 bit. So you maybe should try python 64 bit if that is possible.
Best regards, Sebastian
Thank you, Sebastian My OS is Windows10 64bit. I use python to manipulate 32bit software, which is not compatible with the 64bit python, and the other 64bit software, which are all compatible with 32bit python. So for the compatibility, I tend to use 32bit python. I will try the other way around and I will issue it if I find the way. Best regards, Shu Chun ZHENG
Hello, After several tests, I find pyleecan can install via pip while the version of python is 3.8 64BIT. The reason why pyleecan is not compatible with python 32BIT is that pyleecan rely on some 64bit packages which are not compatible with 32BIT python. And do not install pyleecan with the python version big than 3.8 .
Hello, could you tell which package this is. Maybe there is some chance to have a substitute for it. BR Sebastian
Hello, I am not sure if I am correct for I just tried to install pyleecan with python 3.9 32bit and 3.8 32bit manually via setup.py, and it failed in the 'h5py' , and I tried other way around by puting the code in the path 'C:\Program Files\Python38\Lib\site-packages', and tried to run run_GUI.py in the pycharm, so I got the error track to the 'h5py' and after a seach in the pypi, I found the package 'h5py' only available for window 64bit. I am a amateur in python and if I am wrong, please point out. I only did those two tests and I know it not enough to pin the real problem. Meanwhile it is not rush to adjust pyleecan for 32bit python. I am focus on the project of using pyleecan to build a model suitable for my python Taguchi Methods optimization script and I will share my experience of the modeling base on pyleecan. Shu Chun Zheng
HI, I am trying to install Pyleecan on windows10 with python 3.10.2, pip 22.0.03. So far I think have 2 problems:
- The installing stops with installing deap: " error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [1 lines of output] error in deap setup command: use_2to3 is invalid. [end of output]" 2) the installing give errors with pyvista, it tries all versiosn and gives error on depends on vtk.
How to proceed? Erik
Hello, Thank you for your interest in pyleecan. I'm personnaly on windows 10 (64 bits) using python 3.8.6 and I managed to install pyleecan 1.3.8 with pip 20.2.1 We haven't checked if pyleecan is installable on all python version (although I don't see why it wouldn't be). Is it possible for you to try another python version maybe ?
If it can help here are my current version of the requirements of pyleecan: cloudpickle 2.0.0 ddt 1.4.4 deap 1.3.1 ezdxf 0.14.2 h5py 3.6.0 matplotlib 3.3.4 meshio 4.4.6 mock 4.0.3 nbconvert 6.4.1 nbformat 5.1.3 numpy 1.21.4 pandas 1.4.0 pyfemm 0.1.3 PyQt5 5.15.4 PyQt5-Qt5 5.15.2 PyQt5-sip 12.8.1 PySide2 5.15.2.1 pytest 7.0.0 pytest-excel 1.5.0 pytest-qt 4.0.2 pyuff 2.0 pyvista 0.31.3 pyvistaqt 0.5.0 quadpy 0.16.10 SciDataTool 2.2.3 scipy 1.8.0 setuptools 60.8.1 swat-em 0.6.3 xlrd 2.0.1 xlwt 1.3.0
Hope it helps, Best regards, Pierre
Hi Pierre,
With your python version, everything works ok now. I have installed all the packages manually but I had to install first numpy before I could install matplotlib.
With pytest I had an error concerning permission error on the application data....But I can work now with the program. I run it from the windows cmd. I will test now the rest, first machine I put in gave some errors with producing the femm file. But maybe I did something wrong. I am mostly interested in simulating large HV machines (10 poles etc).
Thank you for the help.
Regards,
Erik
Op vr 18 feb. 2022 om 09:27 schreef Pierre Bonneel @.***
:
Hello, Thank you for your interest in pyleecan. I'm personnaly on windows 10 (64 bits) using python 3.8.6 and I managed to install pyleecan 1.3.8 with pip 20.2.1 We haven't checked if pyleecan is installable on all python version (although I don't see why it wouldn't be). Is it possible for you to try another python version maybe ?
If it can help here are my current version of the requirements of pyleecan: cloudpickle 2.0.0 ddt 1.4.4 deap 1.3.1 ezdxf 0.14.2 h5py 3.6.0 matplotlib 3.3.4 meshio 4.4.6 mock 4.0.3 nbconvert 6.4.1 nbformat 5.1.3 numpy 1.21.4 pandas 1.4.0 pyfemm 0.1.3 PyQt5 5.15.4 PyQt5-Qt5 5.15.2 PyQt5-sip 12.8.1 PySide2 5.15.2.1 pytest 7.0.0 pytest-excel 1.5.0 pytest-qt 4.0.2 pyuff 2.0 pyvista 0.31.3 pyvistaqt 0.5.0 quadpy 0.16.10 SciDataTool 2.2.3 scipy 1.8.0 setuptools 60.8.1 swat-em 0.6.3 xlrd 2.0.1 xlwt 1.3.0
Hope it helps, Best regards, Pierre
— Reply to this email directly, view it on GitHub https://github.com/Eomys/pyleecan/issues/120#issuecomment-1044132493, or unsubscribe https://github.com/notifications/unsubscribe-auth/AX2EMD22YKFWW6PB4YK3T53U3X7IVANCNFSM4OQYRDBQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you commented.Message ID: @.***>
-- Erik Smith
Great to know that you managed to install pyleecan :) Regarding your machine you can share your error messages in a dedicated issue if you need any assistance.
Best regards, Pierre
Hi Pierre,
I have installed Anaconda and made my own environment for Pyleecan. Works great but I have some problems. When I use the tuto-Machine, the Toyota_Prius json file comes up with only one phase (A+ and A-). And ofcourse a lot of errors when I follow the tutorials. When I open Pyleecan and select the same file, you definitely see the 3 phases. What is going wrong? Then in Pyleecan when I select Plot Stator Unit MMF, the FFM harmonic is not showing, see enclosed picture.
When I put in a high voltage machine, I get still errors (always the same error, independent of the 2 designs tested) when I want to export to FEM. The error code is: "[13:26:24] Error while drawing machine 160323 EQRG560LB2 in FEMM: unsupported operand type(s) for *: 'int' and 'NoneType'" I think I missed something in the installation? I have enclosed the sample json file. Femm works with the example json files you send with the Pyleecan installation.
Any idea's? Kind regards,
Erik
Op vr 18 feb. 2022 om 17:06 schreef Pierre Bonneel @.***
:
Great to know that you managed to install pyleecan :) Regarding your machine you can share your error messages in a dedicated issue if you need any assistance.
Best regards, Pierre
— Reply to this email directly, view it on GitHub https://github.com/Eomys/pyleecan/issues/120#issuecomment-1044761116, or unsubscribe https://github.com/notifications/unsubscribe-auth/AX2EMD22UQ5B6EY4SIYBLSLU3ZU7HANCNFSM4OQYRDBQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you commented.Message ID: @.***>
-- Erik Smith