I'm trying to modify the open source below using pycham tool, but there's an error like below, so I'd like to ask for some advice.

Asked 2 years ago, Updated 2 years ago, 20 views

Hello from pycham tool https://github.com/mete0r/pyhwp.git clone the source of master and hwp5proc of srcI ran py

C:\Users\kyshi\AppData\Local\Programs\Python\Python37\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1.2\plugins\python-ce\helpers\pydev\pydevconsole.py" --mode=client --port=63123
import sys; print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend(['C:\\Projects\\pyhwp', 'C:/Projects/pyhwp'])
PyDev console: starting.
Python 3.7.7 (tags/v3.7.7:d7c567b08f, Mar 10 2020, 10:41:24) [MSC v.1900 64 bit (AMD64)] on win32
runfile('C:/Projects/pyhwp/src/hwp5/hwp5proc.py', wdir='C:/Projects/pyhwp/src/hwp5')
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1.2\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1.2\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "C:/Projects/pyhwp/src/hwp5/hwp5proc.py", line 28, in <module>
    from . import __version__
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1.2\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
ImportError: attempted relative import with no known parent package

Why does this error occur? I'm asking because I'm frustrated that there's no alternative to Googleing. I really need to fix this guy, but it's hard. Thank you.

python

2022-09-20 21:51

2 Answers

After pip install pyhwp, there will be an executable file in the script folder.


2022-09-20 21:51

Use the requirement.txt in the git.

pip install -r requirement.txt


2022-09-20 21:51

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.