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.
#๐ Package import issue
77 messages ยท Page 1 of 1 (latest)
@lusty drift
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.
Closes after a period of inactivity, or when you send !close.
Try in virtual environment
First of all, pwn sounds like the sketchiest lib
but can you show the code for pwn?
it's not a package that I made
I use it for CTFs specifically Crypto ones
the same error goes with pycryptodome
What's it do? Do you have a link for it?
remote connection to instances
and pycryptodome also
There's no way this doesn't break the server rules
!rule 5
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
ok sorry what can I do then
something else
What are you trying to do?
and reinstalling windows twice
I am a ctf player and sometimes maybe most of the times I need these packages
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
Mods help - is this okay? Seems white-hat to me but i can't really tell
do you think that I am a kind of a exploit maker or a white hat hacker?
yeahhh CTFs are a bit of a grey area as far as our rules go
in some cases not even just for being hacking-tangent, but active CTF competitions also fall under the 'ongoing exams' rule
first of all you probably should be using a sandboxed Linux VM instead of Windows though
The problem is how it fits into the rules of the server
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
If your project violates the rules overall, we don't care what your specific question is
As etrotta said, it's a grey area
Can you search up BackHatMEA or ICMTC
but i agree with the linux suggestion
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
It doesn't relate to any cybersecurity term this is some sort of a package problem. But thanks very helpful tho
ironically
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
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
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)
with quotes
ok so it is specific to that package in particular
well, either that or your environment or IDE
I tried creating a new venv but some thing happens
#cybersecurity 
It works with sagemath
Yea I sent smthn there
waiting for someone to reply
Can you try py -c "import pwn" too?
and py -c "from pwn import *" because that's what the docs say to do
ok at least we have a better stack trace now
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
Here was the fix commit:
https://github.com/Gallopsled/pwntools/commit/4879590a37f4fe726dbd9ec276154b05449abefe
ah but it's in the prerelease
maybe can you pip install pwntools==4.14.0beta0
Ok wait I'll try that out
So the problem is in the package itself
Ok that works
damn
It's only on windows though. If you switch to linux it should work
Yea I know I've tried on a vm
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.