cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you interested in hearing how one of our Community members uses Dropbox for sailing trips? Read all about it here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Python error on "import dropbox"

Python error on "import dropbox"

PhoggBandit
Explorer | Level 3

Today I successfully installed Python 3.9.7 and the latest Pycharm version. I also installed the Dropbox API via the command:

 

  pip install dropbox

 

But my ONE-line Python program:

 

   import dropbox

 

fails with:

 

Traceback (most recent call last):
File "G:\pytest\main.py", line 2, in <module>
import dropbox
ModuleNotFoundError: No module named 'dropbox'

 

What am I doing wrong? How can I load the Dropbox APIs?

 

 

3 Replies 3

Greg-DB
Dropbox Staff

It's possible you actually have multiple versions of Python installed, so make sure you've installed the Dropbox package in the same Python environment that you're using to run your program. (For instance, you mentioned you're using Python 3.9.7, so depending on your setup you may need to use "pip3" to install packages instead of just "pip".)

 

Otherwise, there may be an issue with where/how your Python environment is looking for installed Python packages, such as via your PYTHONPATH setting. Refer to the Python documentation for information on configuring your environment.

PhoggBandit
Explorer | Level 3

@Greg-DB,

 

Thanks for the prompt reply!

 

From the Windows command prompt "import dropbox" imbedded in a test script was working fine:

 

 c:\> py test.py

 

but was still failing even after I tried uninstalling Dropbox and reinstalling with the "pip3" command. I finally got it working from PyCharm by creating a new project and ticking the checkbox "Inherit global-site packages."

 

* Point forward, should I also tick the checkbox "Make available to all projects"?

 

* For an existing project, how can I enable the "Inherit global-site packages" setting? I realize I can simply create a new project and copy/paste code...

Greg-DB
Dropbox Staff

We can't provide support for using and configuring PyCharm, as it's not made by Dropbox. I recommend referring to the PyCharm documentation and support resources for guidance on that.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    PhoggBandit Explorer | Level 3
What do Dropbox user levels mean?