Python Forum
[SYS + OS] Script not Imported, Error Found !
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SYS + OS] Script not Imported, Error Found !
#3
If scripts are in same folder or in jamics.py in PYTHONPATH.
C:\foo\
  |-- jamics.py
  |-- run.py
# jamics.py
def jam():
    return ("Jamics Imported !...")
# run.py
import jamics

# using module jamics
print(jamics.jam())
Test:
Output:
C:\foo λ python run.py Jamics Imported !..
Placing jamics.py in a place Python do not search(sys.path).
import sys
# Before import jamics
sys.path.append('C:/somefolder/anotherfolder')
import jamics

# using module jamics
print(jamics.jam())
Reply


Messages In This Thread
RE: [SYS + OS] Script not Imported, Error Found ! - by snippsat - Sep-22-2017, 08:03 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  file open "file not found error" shanoger 8 1,165 Dec-14-2023, 08:03 AM
Last Post: shanoger
  Module Not Found Error bitoded 4 1,423 Jan-01-2023, 09:08 AM
Last Post: bitoded
  File not found error saisankalpj 10 3,884 Jul-04-2022, 07:57 AM
Last Post: saisankalpj
  Can a module tell where it is being imported from? stevendaprano 3 1,194 Apr-12-2022, 12:46 AM
Last Post: stevendaprano
  module detecting if imported vs not Skaperen 1 1,686 Nov-19-2021, 07:43 AM
Last Post: Yoriz
  TypeError: sequence item 0: expected str instance, float found Error Query eddywinch82 1 5,138 Sep-04-2021, 09:16 PM
Last Post: eddywinch82
  Error when refering to class defined in 'main' in an imported module HeRo 2 2,421 Apr-13-2021, 07:22 PM
Last Post: HeRo
  [newbie] Why is a module imported twice? Winfried 3 4,094 Apr-02-2021, 04:48 AM
Last Post: deanhystad
  How can I found how many numbers are there in a Collatz Sequence that I found? cananb 2 2,559 Nov-23-2020, 05:15 PM
Last Post: cananb
  Unknown error occurred: Port not found NewBeie 0 1,445 Aug-27-2020, 08:50 PM
Last Post: NewBeie

Forum Jump:

User Panel Messages

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