0

I am mac os user and i am new to python3. I created package. Python do not recognize the module from package because i guess directory was not saved for that package.

this is how I did for adding new directory.

1) open terminal and type

nano .bash_profile

2) type and save

PYTHONPATH=“${PYTHONPATH}:/Users/hunminpak/Documents/game/sound/ export PYTHONPATH”

3) In Python, typed

import game.sound

Traceback (most recent call last):
  File "<pyshell#14>", line 1, in <module>
    import game.sound
ModuleNotFoundError: No module named 'game.sound'

Please help me why my directory was not added.

1 Answers1

0

Issue is in your second command. Change it from

PYTHONPATH=“${PYTHONPATH}:/Users/hunminpak/Documents/game/sound/ export PYTHONPATH”

to two commands.

First command (remove the trailing /): PYTHONPATH=“${PYTHONPATH}:/Users/hunminpak/Documents/game/sound"

Hit enter and then type second command:

export PYTHONPATH
Vimanyu
  • 625
  • 2
  • 9
  • 24