Hello, I’m trying to make a command prompt thingy. When I try and open it in a preview on PyChamp the code runs fine, but in a regular file it closes, and I was able to see the error Python error Traceback(most recent call last): I know the problem is where I try to import pythonroblox. Any help?
import pythonroblox
import time
import os
ex = 0
print("Thanks for using me! Type 'commands' for help!")
while ex < 1:
cmdd: str = input("Enter a valid command: ")
if cmdd == "group":
grp: str = input("Group ID here: ")
groups = pythonroblox.Groups()
result = groups.search_id(grp)
groupmem = result.member_count
groupname = result.name
groupid = result.id
descg = result.description
groupown = result.owner_name
print("Searching..")
time.sleep(1)
print("["+groupname+"]", "Member Count:", groupmem, "| Group Owner:", groupown, "| Description:", descg, "| Group ID:", groupid)
EDIT: sorry if this has an obvious answer, I just started a few days ago.
Hello, I’m trying to make a command prompt thingy. When I try and open it in
a preview on PyChamp the code runs fine, but in a regular file it closes, and
I was able to see the error Python error Traceback(most recent call last): I
know the problem is where I try to import pythonroblox. Any help?
Paste this line at the very top of you file and run it again:
import sys; print(f"Try running: {sys.executable} -m pip install <package_name>"); sys.exit(0)
It will suggest a command to run from the command line.
Run that command, replacing <package_name>
with just pythonroblox
,
remove the helpful line you added the top and try running your program again as
before.
Does it work?
print(pythonroblox.__file__)
Do you get an error? Now try the same thing without using PyChamp. Do
you get an error now?
If so, then the two environments are different.
In PyChamp, run this:
import sys
print(sys.version)
print(sys.executable)
Then do the same thing without PyChamp. How are they different?