Python Forum
Help with importing a module from a package I created.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with importing a module from a package I created.
#3
(Mar-12-2019, 08:43 AM)snippsat Wrote:
(Mar-12-2019, 01:57 AM)FWendeburg Wrote: My question is: How do I change this so I'm able to import them like:
from w_encryption import encrypt_text
Yes this is the way it should be done,never make a package that use *.

Quote:Do I have to edit the __init__.py file? Now I have it like this:
Look a this post,see how i lift the sub modules.
look at the . that's needed for doing this.
snippsat Wrote:.color import base_color

Thanks! It works now xd.
Reply


Messages In This Thread
RE: Help with importing a module from a package I created. - by FWendeburg - Mar-12-2019, 04:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  importing variables from module 8376459 1 273 Feb-18-2024, 02:24 PM
Last Post: deanhystad
  no module named 'docx' when importing docx MaartenRo 1 847 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  My code displays too much output when importing class from a module lil_e 4 1,154 Oct-22-2022, 12:56 AM
Last Post: Larz60+
  pdfminer package: module isn't found Pavel_47 25 8,815 Sep-18-2022, 08:40 PM
Last Post: Larz60+
  "ModuleNotFoundError: No module named 'PyQt5.QtWidgets'; 'PyQt5' is not a package" chipx 3 7,427 Dec-09-2021, 07:05 AM
Last Post: chipx
Question Setuptools CLI program ModuleNotFoundError after splitting up module into package Postbote 1 2,312 Nov-25-2021, 06:35 PM
Last Post: Postbote
  Importing module in jupyter Noteboook ajitnayak1987 0 1,741 Jun-04-2021, 12:26 PM
Last Post: ajitnayak1987
  ERROR: importing desired module mbgamer28 0 1,674 Apr-05-2021, 07:46 PM
Last Post: mbgamer28
  newbie question....importing a created class ridgerunnersjw 5 2,636 Oct-01-2020, 07:59 PM
Last Post: ridgerunnersjw
  ModuleNotFoundError: No module named 'scipy.optimize'; 'scipy' is not a package AaronKR 1 10,237 Jul-09-2020, 02:36 AM
Last Post: bowlofred

Forum Jump:

User Panel Messages

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