0

This is a continuation of the question I had asked in another thread:

Using packages by providing sys path

The sys.path.append idea worked great. I understand that path has to be provided to location of init.py. But now I am trying to call a python package written in C which doesn't have init.py:

https://github.com/Komnomnomnom/swigibpy/

(1) How do I call the package when it doesn't have init.py

(2) When the package is written in C ?

Edit: I am in a situation where I can't install libraries on the machine I will be working on and only access I have is through USB.

I downloaded and extracted swigibipy on my desktop. I tried the following:

import sys    
sys.path.append(r'C:\Users\Duck\Desktop\swigibpy-master')
import swigibpy

But the error is:

No module named swigibpy
Community
  • 1
  • 1
Zanam
  • 4,607
  • 13
  • 67
  • 143
  • If it doesn't have an `__init__.py` it's not a package. The difference between a directory and a package is that a package has a file called `__init__.py` in it. However, in your case swigibpy is a module, not a package, and you can just do 'import swigibpy', as the README at your link shows. – Wander Nauta Dec 19 '15 at 12:35
  • I don't understand why you don't want to install these libraries. At least use a virtualenv. – Daniel Roseman Dec 19 '15 at 12:55

0 Answers0