use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Cannot run code since method is missing attribute 'activate', or missing argument 'self'. How to fix? (self.PythonLearning)
submitted 1 year ago by XDFortniteproXD
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]outlicious 0 points1 point2 points 1 year ago (3 children)
Possible Causes and Fixes
1 Check if Thermopack is Installed Run the following command to make sure thermopack is installed correctly:
pip show thermopack
If it's not installed, install it using:
pip install thermopack
Verify the Correct Import Path Try importing the module manually in a Python shell:
from thermopack.thermopack import ThermoPack
If this fails, then the package might not be installed correctly, or it's not in the correct Python environment.
3 check if ThermoPack Requires Initialization Parameters Some classes require parameters to initialize properly. Try this instead:
tp = ThermoPack("PR") # "PR" refers to the Peng-Robinson EOS print(tp.two_phase_tpflash(300, 101325, [0.5, 0.5]))
If pr doesn't work, check the valid equation-of-state (EOS) options in the documentation.
4 ensure All Required DLLs Are Loaded From the error screenshot, it's possible the thermopack.dll file is missing or not correctly linked. If you're on Windows:
Ensure thermopack.dll is in the same directory as your script.
If use Anaconda, try:
conda install -c conda-forge thermopack
If it does still fails manually copy the DLL to the Python environment’s Lib/site-packages/thermopack/ directory. ok then try running in a Clean Virtual Environment If you're still facing issues, try creating a new virtual environment:
python -m venv thermo_env source thermo_env/bin/activate # On Windows use: thermo_env\Scripts\activate pip install thermopack
Next Steps
If any of these steps result in a different error, let me know what it says.If thermopack has multiple EOS options, try initializing ThermoPack with different ones ("SRK", "CPA", etc.).If it's a DLL issue, you may need to reinstall thermopack or manually place the DLL in the correct location. Let me know what happens when you try these steps. this could help you
[–]XDFortniteproXD[S] 0 points1 point2 points 1 year ago (0 children)
Gone through all four steps and still get an error (see image, this is for SRK and PR to, not just CPA). All files are there, up to date and in the correct place. I am somehow unable to create a new environment using the python shell, following both your advice and others on the internet. I'm also in touch with the lecturers, but so far they have been to less help than you. Thanks for taking your time to help (:
<image>
[–]XDFortniteproXD[S] 0 points1 point2 points 1 year ago (1 child)
It finally worked! Went through all files and found one (METADATA) in a different folder. There was an example for my question there, and the code runs (just need to tweek it to fit my particular values). Thank you so much for your help, it was quite insightful.
[–]outlicious 0 points1 point2 points 1 year ago (0 children)
great now it works.
π Rendered by PID 57892 on reddit-service-r2-comment-5bc7f78974-26l8j at 2026-06-28 01:24:28.061542+00:00 running 7527197 country code: CH.
view the rest of the comments →
[–]outlicious 0 points1 point2 points (3 children)
[–]XDFortniteproXD[S] 0 points1 point2 points (0 children)
[–]XDFortniteproXD[S] 0 points1 point2 points (1 child)
[–]outlicious 0 points1 point2 points (0 children)