hello I'm new to python3 and python3.6, I usually use pip3 install to add old libraries to my python3 path.
I recently picked up python3.6 for managing my home servers with its asyncio functionalities however my python3.6 interpreter is unable to locate pwnlibs and am thus unable to reuse my old code.
I tried:
import sys
import os
sys.path.append(os.path.abspath(pwn.__file__))
import pwn
debugging results:
on python3.4 os.path.abspath(pwn.__file__) returns the correct path to the library
While
sys.path.appendis a valid means to add to your python path at runtime, you can't get the path from a module you have not yet loaded.Instead you should install your packages using pip3 or in a specific location and add that to your path either at runtime or via the
PYTHONPATHenvironment variable.I would guess since you mentioned
pip3already however that you had thepwnpackage already installed when you tried with 3.4 and your install of Python 3.6 is not using the same paths as your Python 3.4 install. Try comparing your python paths from 3.4 with 3.6 by comparing the output fromsys.path.Lastly, just as a note, if you are using the
pwntoolspackage, it doesn't yet support Python 3, so if you are simply copying the folder, be aware it might not function correctly or at all.