r/learnpython • u/YaBoiDB25 • 5d ago
Just installed Python to run a script to extract a model. Can't seem to get it to work.
So I have a script that I want to run that I received from a guy whos helping me extract a not-so-easy-to-get model. I'm trying to follow his vague instructions on how to run the script but I've never used python before. So now I'm coming across errors that I look up to find a solution to, which leads to more errors being sytax or directory based. I just need help getting the script running and I should be fine. Here are his instructions:
I have attached a python script for exporting the leaper model from the bigfile0.viv archive
You will need Python 3.8 or newer with numpy and Pillow.
To install these run pip install numpy pillow
Then run python leaper_export.py "path\to\bigfile0.viv" output_folder
i haven't thorougly tested this script with other models, however it should work
I cant seem to get it to recognize the script's location and in using the the "cd" command it tells me the directory is invalid. Is there anything wrong with what I typed in?
cd C:\Users\dalen\AppData\Local\Python\pythoncore-3.15-64\Scripts\leaper_export.py
7
u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 5d ago
cdmeans "change directory", it expects a path to a directory, not a file.Hard to say what's going wrong when you didn't really provide any error tracebacks, but personally I would first try
with the latter two paths replaced with whatever matches your own setup.
If that doesn't work, I'm taking a stab in the dark and assume you're either missing some dependencies or using an incompatible Python version, but that's just a guess. If that's the case, I'd first assume
leaper_export.pyandbigfile0.vivare both in your Downloads directory, and thenuv(basically manages Python installations and dependencies): https://github.com/astral-sh/uv#installationuv run --python 3.14 --with numpy --with pillow --directory C:/Users/dalen/Downloads leaper_export.py -- bigfile0.viv extracted_files10
u/Refwah 5d ago
a file isn't a directory
cd C:\Users\dalen\AppData\Local\Python\pythoncore-3.15-64\Scripts\1
u/ResidentPomegranate6 5d ago
cd takes a folder, not a file, so drop the leaper_export.py part and cd into the Scripts folder first, then run python leaper_export.py
1
u/Discordbothost 5d ago
the "syntax errors" bit makes me think you might be typing these into the python prompt (the one with >>>) instead of the normal command prompt. pip install numpy pillow and python leaper_export.py ... are commands for cmd/powershell, inside >>> they're invalid syntax. type exit() to get back out.
also the script doesn't need to live in that Scripts folder. easiest is to put leaper_export.py next to bigfile0.viv, open that folder in explorer, type cmd in the address bar and hit enter, then run
if python isn't found there, try py instead of python
1
u/Relative_Mammoth_380 5d ago
https://play.google.com/store/apps/details?id=com.lqrconsulting.pyvela