Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

PhoggBandit's avatar
PhoggBandit
Explorer | Level 3
5 years ago

Python error on "import dropbox"

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

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    5 years ago

    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's avatar
    PhoggBandit
    Explorer | Level 3
    5 years ago

    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's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    5 years ago

    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.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!