Skip to content
Fix Code Error

How to add to the PYTHONPATH in Windows, so it finds my modules/packages?

March 13, 2021 by Code Error
Posted By: Anonymous

I have a directory which hosts all of my Django apps (C:My_Projects). I want to add this directory to my PYTHONPATH so I can call the apps directly.

I tried adding C:My_Projects; to my Windows Path variable from the Windows GUI (My Computer > Properties > Advanced System Settings > Environment Variables). But it still doesn’t read the coltrane module and generates this error:

Error: No module named coltrane

Solution

You know what has worked for me really well on windows.

My Computer > Properties > Advanced System Settings > Environment Variables >

Just add the path as C:Python27 (or wherever you installed python)

OR

Then under system variables I create a new Variable called PythonPath. In this variable I have C:Python27Lib;C:Python27DLLs;C:Python27Liblib-tk;C:other-folders-on-the-path

enter image description here

This is the best way that has worked for me which I hadn’t found in any of the docs offered.

EDIT: For those who are not able to get it,
Please add

C:Python27;

along with it. Else it will never work.

Answered By: Anonymous

Related Articles

  • Error 'Map', but got one of type 'Null' flutter web…
  • coercing to Unicode: need string or buffer, NoneType…
  • Ubuntu apt-get unable to fetch packages
  • What is the worst programming language you ever worked with?
  • Django: ImproperlyConfigured: The SECRET_KEY setting…
  • Error message "Forbidden You don't have permission…
  • Error using core-scaffold from polymer JS in the…
  • Can't install via pip because of egg_info error
  • Django GraphQL API with JWT authentication…
  • How to upload a file in Django?
  • Setting DEBUG = False causes 500 Error
  • Vue js vuecli3 application does not work in ie11…
  • How do I connect to this localhost from another…
  • Django admin/ return 404
  • django import error - No module named core.management
  • How to use MySQLdb with Python and Django in OSX 10.6?
  • ImproperlyConfigured: You must either define the…
  • django.core.exceptions.ImproperlyConfigured: Error…
  • How to avoid "module not found" error while calling…
  • TypeError: int() argument must be a string, a…
  • Aurelia UX showcase app fails to load
  • Visual Studio Code pylint: Unable to import 'protorpc'
  • How can I use a Python script in the command line…
  • Django DB Settings 'Improperly Configured' Error
  • How do I run a Python program in the Command Prompt…
  • Django model "doesn't declare an explicit app_label"
  • OperationalError, no such column. Django
  • Django & VSCode: can't create super user
  • Django website can't find template in new project website
  • Django TemplateDoesNotExist?
  • TypeError: Cannot read property 'webpackJsonp' of undefined
  • Does Django scale?
  • Best practice for Django project working directory structure
  • vue js + django app architecture
  • What exactly should be set in PYTHONPATH?
  • Add Allauth login_required decorator to…
  • How should I deal with "package '✘✘✘' is not…
  • Aurelia bundling issue with virtual directory
  • How to get the PYTHONPATH in shell?
  • pip install failing with: OSError: [Errno 13]…
  • Apache server keeps crashing, "caught SIGTERM,…
  • Where is Python's sys.path initialized from?
  • Django upgrading to 1.9 error "AppRegistryNotReady:…
  • What does on_delete do on Django models?
  • Django 1.7 throws…
  • How to solve Internal Server Error in Next.Js?
  • How to change the name of a Django app?
  • ImportError: No module named sqlalchemy
  • Ember Data nested Models
  • How to add Typescript to a Nativescript-Vue project?
  • Show Console in Windows Application?
  • UPDATED!: Time Converter - Assigned functions do not work
  • Django: TemplateSyntaxError: Could not parse the remainder
  • Relative imports for the billionth time
  • Python - add PYTHONPATH during command line module run
  • python 3.2 UnicodeEncodeError: 'charmap' codec can't…
  • Created variable inside for loop can't be accessed…
  • 'int' object has no attribute 'user_list'. (Django…
  • Display progress bar while doing some work in C#?
  • How can I find the product GUID of an installed MSI setup?
  • Install mysql-python (Windows)
  • Quickly reading very large tables as dataframes
  • import error: 'No module named' *does* exist
  • Safely limiting Ansible playbooks to a single machine?
  • What are the real-world strengths and weaknesses of…
  • Django Blog - Comment System
  • Field defines a relation with the model 'auth.User',…
  • Underscore / Backbone templating with Django
  • ExpressJS How to structure an application?
  • Django: class-view lacking attribute COOKIES
  • Convert Django Model object to dict with all of the…
  • Rename computer and join to domain in one step with…
  • Jenkins with nginx using docker Port 50000 config
  • Singleton Object for Dynamically Imported Module in Next.js
  • using backbone/ember makes django being a simple REST API?
  • Python File Error: unpack requires a buffer of 16 bytes
  • Import Error: No module named django
  • Installing Python 2.7 on Windows 8
  • Why am I getting a "401 Unauthorized" error in Maven?
  • "ImportError: No module named" when trying to run…
  • pip cannot install anything
  • Smart way to truncate long strings
  • How to update Python?
  • Weaseyprint, Cairo, Dajngo on Pythonanywhere 25MAY21…
  • Integrating Ember CLI with Django app
  • AHK How to pass variables to "Run" inside a function?
  • ImportError: No module named 'django.core.urlresolvers'
  • What is the path that Django uses for locating and…
  • How do I use namespaces with TypeScript external modules?
  • Django - Reverse for '' not found. '' is not a valid…
  • Django saml2 login missing session variables
  • Python and pip, list all versions of a package…
  • adding directory to sys.path /PYTHONPATH
  • Google Forms file upload complete example
  • Python: importing a sub‑package or sub‑module
  • Warning: Auto-created primary key used when not…
  • Django, Next.JS: CORS header…
  • Django MEDIA_URL and MEDIA_ROOT
  • Django-RestFramework 2 and backbone.js routing
  • useEffect Error: Minified React error #321 (GTM…

Disclaimer: This content is shared under creative common license cc-by-sa 3.0. It is generated from StackExchange Website Network.

Post navigation

Previous Post:

Host ‘✘✘✘.xx.✘✘✘.✘✘✘’ is not allowed to connect to this MySQL server

Next Post:

How to vertically align elements in a div?

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

.net ajax android angular arrays aurelia backbone.js bash c++ css dataframe ember-data ember.js excel git html ios java javascript jquery json laravel linux list mysql next.js node.js pandas php polymer polymer-1.0 python python-3.x r reactjs regex sql sql-server string svelte typescript vue-component vue.js vuejs2 vuetify.js

  • you shouldn’t need to use z-index
  • No column in target database, but getting “The schema update is terminating because data loss might occur”
  • Angular – expected call-signature: ‘changePassword’ to have a typedeftslint(typedef)
  • trying to implement NativeAdFactory imports deprecated method by default in flutter java project
  • What should I use to get an attribute out of my foreign table in Laravel?
© 2022 Fix Code Error