erocarrera / pefile

pefile is a Python module to read and work with PE (Portable Executable) files
MIT License
1.86k stars 519 forks source link

Problem opening PE32 file #335

Closed mjbroekman closed 3 years ago

mjbroekman commented 3 years ago

I installed python3 with Homebrew and along with pip3 and used pip3 to install pefile. When I use the example script:

import pefile
pe = pefile.PE('filename')
for section in pe.sections:
      print("%s %s" % (section.PointerToRawData),hex(section.Misc_VirtualSize))

I get the following error: AttributeError: partially initialized module 'pefile' has no attribute 'PE' (most likely due to a circular import)

mjbroekman commented 3 years ago

This is with:

Name: pefile
Version: 2021.9.3
Summary: Python PE parsing module
Home-page: https://github.com/erocarrera/pefile
Author: Ero Carrera
Author-email: ero.carrera@gmail.com
License: MIT
Location: /opt/homebrew/lib/python3.9/site-packages
Requires: future
Required-by: 
mjbroekman commented 3 years ago

Ignore this. I called my test file pefile.py... so of course it was a circular import.