Python Forum
Installing a python package using pip
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Installing a python package using pip
#1
Hi,

This is a continuation of a thread I posted last week .
I have a python package that is a wrapper around some c++ libs with a python interface.
this works absolutely perfectly when you add the location of the pyd to the path and import

I have created a pip install package using distutils.core setup functionality.

The package is created and the tarball is put in the Libs/site-packages location of my python directory.
I then run pip.exe install myPackage.tarball

Pip successfully installs the package . untarring all the files to the directory under libs/site-packages .

If i set my path to that particular directory and import the package into my python script then its all good and i can use the package perfectly.

However, if i open the python environment andjust import ther package.. the package imports perfectly , but i cannot access any of my functions (that i could do when the pyd is part of the path) .

I think it has someting to sdoc with the loader class used to actually install the package .

#this is the script without the pyd location as part of the path
importlib.find_loader('myPackage')

_frozen_importlib_external._NamespaceLoader object at 0x006B7D70>


however, if the package is successfully loaded in the same function call gives .

_frozen_importlib_external.ExtensionFileLoader object at 0x006B7CF0>

So is there a way i can tell pip to is the ExtensionFileLoader instead of the Namespace loader .


any advice here would be great .
thanks
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to run utilities from a Python package? LugosisGhost 1 389 Dec-27-2023, 12:00 PM
Last Post: Larz60+
  Python package not seen in VSCode fmccabe80 6 3,080 Mar-06-2023, 10:01 PM
Last Post: fmccabe80
  Is it possible to see dependencies before installing a package? quazirfan 4 1,029 Dec-06-2022, 02:50 PM
Last Post: snippsat
  Math Package in python Uma 1 1,462 Dec-12-2021, 02:01 PM
Last Post: jefsummers
  Unable to import sklearn after installing any package ilango 0 1,160 Oct-25-2021, 07:03 AM
Last Post: ilango
  Python IDE doesn't see opencv-python package on my Jetson Nano sadhaonnisa 1 3,290 Oct-11-2020, 01:04 AM
Last Post: Larz60+
  Help needed for a python package keysson 1 2,175 Sep-02-2020, 03:37 AM
Last Post: Larz60+
  Python package as installable Prabakaran141 0 1,468 Mar-10-2020, 10:07 AM
Last Post: Prabakaran141
  Installing a new package using pip in conda environment firebolt7 1 2,482 Nov-18-2019, 12:31 PM
Last Post: snippsat
  Help with understanding a python package pyhill00 4 2,965 Mar-21-2019, 12:42 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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