#๐Ÿ”’ Package import issue

77 messages ยท Page 1 of 1 (latest)

lusty drift
#

I've an issue with importing packages using python. I've tried python 3.12 and 3.11 but none of them seems to resolve the problem. I installed this package using pip and when I tried to run the code, this error appeared. The same error shows up with importing the pycryptodome package too. I need a quick solution for this issue since I have a contest and I need to resolve this error as soon as possible.

vast vigilBOT
#

@lusty drift

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

white shale
#

Try in virtual environment

polar turret
#

First of all, pwn sounds like the sketchiest lib

#

but can you show the code for pwn?

lusty drift
#

it's not a package that I made

#

I use it for CTFs specifically Crypto ones

#

the same error goes with pycryptodome

polar turret
lusty drift
#

and pycryptodome also

polar turret
#

There's no way this doesn't break the server rules

lusty drift
polar turret
#

!rule 5

vast vigilBOT
#

5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.

lusty drift
#

ok sorry what can I do then

polar turret
#

something else

lusty drift
#

I need to solve this error as soon as possible

#

I tried venvs

polar turret
#

What are you trying to do?

lusty drift
#

and reinstalling windows twice

lusty drift
#

this error popped up like 1-2 months ago

#

I used sagemath on a jupyter notebook and the packages work there properly

#

What I need is to solve this error so that I can get back to my CTFs

polar turret
#

Mods help - is this okay? Seems white-hat to me but i can't really tell

lusty drift
#

do you think that I am a kind of a exploit maker or a white hat hacker?

tiny wagon
lusty drift
#

bruh is the problem with CTFs or the main issue I am having

#

dude

tiny wagon
polar turret
lusty drift
#

So you are telling me that the server rules are restricted to my problem

#

So I can't solve my problem cuz of server rules

tiny wagon
polar turret
#

As etrotta said, it's a grey area

lusty drift
polar turret
#

but i agree with the linux suggestion

tiny wagon
#

you can try asking in #cybersecurity - the regulars there are more familiar with up to which degree we can assist with that sort of question - but honestly that TypeError in particular makes zero sense

lusty drift
#

It doesn't relate to any cybersecurity term this is some sort of a package problem. But thanks very helpful tho

#

ironically

tiny wagon
#

If that package is only ever used within the realm of cybersec, and your problem is specific to that package in particular, then it does falls under that channel

#

if you are getting that error whenever you try to import literally anything at all, there is something very wrong with your installation or computer

lusty drift
#

packages like "string" and "binascii" work just fine

#

those packages that need the "pip install package_name" thingy doesn't work properly that's all

tiny wagon
#

does import pip works on its own? like py -c "import pip" from the command line works and exists without an error or gives a traceback

(normally you wouldn't import pip, but it should be a descent sanity check to see if it's related to third-party packages at all, or specifically related to some X package you're using)

lusty drift
tiny wagon
#

with quotes

lusty drift
#

I think it works

tiny wagon
#

ok so it is specific to that package in particular

#

well, either that or your environment or IDE

lusty drift
#

I tried creating a new venv but some thing happens

tiny wagon
#

#cybersecurity TPF_02_Shrug

lusty drift
#

It works with sagemath

lusty drift
#

waiting for someone to reply

polar turret
#

and py -c "from pwn import *" because that's what the docs say to do

lusty drift
polar turret
#

ok at least we have a better stack trace now

polar turret
# lusty drift

It's definitely a bug but looks like it's been fixed already on the github

#

can you install the latest version of pwn?

#

the line on github is self.num_colors = termcap.get('colors', default=8) if sys.platform == 'win32' else 8 but your version is self.num_colors = termcap.get('colors', 8) if sys.platform == 'win32' else 8

#

the omission of the default= is what breaks it

#

ah but it's in the prerelease

#

maybe can you pip install pwntools==4.14.0beta0

lusty drift
#

Ok wait I'll try that out

#

So the problem is in the package itself

#

Ok that works

#

damn

polar turret
lusty drift
#

Yea I know I've tried on a vm

vast vigilBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.