Python Forum
problem with importing my program
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem with importing my program
#2
You can't import a path, instead you should make sure that your script is somewhere Python knows to find it. It's also a pitfall to name your script the name of an existing module; you can check for this by opening a Python shell and trying to import it before you've created it (e.g. in this case import test, which will work). Your version can "shadow" the built-in version, and if something else relied on it, that thing will be broken.

So: rename your file to something unique, and make sure your path is all good, and things should work as expected.
Reply


Messages In This Thread
problem with importing my program - by meems - Nov-27-2016, 12:22 AM
RE: problem with importing my program - by micseydel - Nov-27-2016, 01:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Some help with my first python class and importing ....im making a lidar program jttolleson 7 1,144 Jul-28-2023, 08:34 AM
Last Post: jttolleson
  Problem with importing python-telegram library into the project gandonio 1 1,515 Nov-01-2022, 02:19 AM
Last Post: deanhystad
  Problem with importing Python file in Visual Studio Code DXav 7 4,897 Jun-15-2022, 12:54 PM
Last Post: snippsat
  Importing Program Wide JarredAwesome 4 2,133 Sep-07-2020, 04:34 PM
Last Post: JarredAwesome
  Please help: problem installing/importing langdetect module in Jupyter Notebook ledgreve 3 7,182 Dec-30-2019, 08:17 AM
Last Post: LeanbridgeTech
  Problem with importing and using collections module pythomdummy 3 5,733 Nov-14-2019, 08:48 AM
Last Post: Gribouillis
  Problem with importing a CSV file Chopan2211 6 7,629 Nov-06-2019, 09:25 AM
Last Post: DeaD_EyE
  Problem importing resource library ChrisM 8 3,866 Oct-23-2019, 01:40 PM
Last Post: ChrisM
  Problem: Once I cancel the process my program will start working! Hadad 0 1,630 Jul-24-2019, 04:09 PM
Last Post: Hadad
  Problem with importing an installed package Reverend_Jim 4 3,643 Jun-14-2019, 10:20 PM
Last Post: Reverend_Jim

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020