Linked Questions

84 questions linked to/from Permanently add a directory to PYTHONPATH?
0 votes
1 answer
666 views

I have a folder called Python Modules which contains single-file modules I've made that I often use, for example one called mytimer.py. I added Python Modules to my Windows PYTHONPATH environment ...
pyjamas's user avatar
  • 5,547
0 votes
0 answers
349 views

Firstly, I am using Fedora 20, Python3.3 Basically everytime I have to use any python libraries I have to use: sys.path.append('/usr/lib/python3.3/site-packages/') This is getting to be a real ...
1871 votes
38 answers
1.6m views

How do I load a Python module given its full path? Note that the file can be anywhere in the filesystem where the user has access rights. See also: How to import a module given its name as string?
1880 votes
36 answers
2.2m views

I want to import a function from another file in the same directory. Usually, one of the following works: from .mymodule import myfunction from mymodule import myfunction ...but the other one gives ...
2268 votes
18 answers
1.9m views

If I make changes to .bashrc, how do I reload it without logging out and back in?
89 votes
23 answers
245k views

I have an Ubuntu 14.04 system, on which I want to install OpenCV and use it with Python 2.x. I installed OpenCV using the instructions here: https://help.ubuntu.com/community/OpenCV The install ...
robm's user avatar
  • 1,051
138 votes
9 answers
81k views

Problem PEP8 has a rule about putting imports at the top of a file: Imports are always put at the top of the file, just after any module comments and docstrings, and before module globals and ...
87 votes
5 answers
320k views

In ruby the library path is provided in $:, in perl it's in @INC - how do you get the list of paths that Python searches for modules when you do an import?
Kyle Burton's user avatar
  • 27.9k
27 votes
5 answers
21k views

Let's assume I have a python package called bestpackage. Convention dictates that bestpacakge would also be a directory on sys.path that contains an __init__.py to make the interpreter assume it can ...
Mark Grey's user avatar
  • 10.3k
21 votes
4 answers
76k views

I'm completely new to Python and want to use it for data analysis. I just installed Python 2.7 on my mac running OSX 10.8. I need the NumPy, SciPy, matplotlib and csv packages. I read that I could ...
marc's user avatar
  • 2,217
14 votes
5 answers
33k views

I installed wxPython 3.0.1.1, but I'm unable to import wx using Python 3.4.1. I am getting the following error: Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 00:54:21) [GCC 4.2.1 (Apple Inc. build ...
Nick's user avatar
  • 10.6k
3 votes
5 answers
25k views

I've read through many of the other S-O questions relating to this, but still am having trouble getting it to work for me. Apologies in advance for the overlap! I'm using python 2.7.10, on Windows 7....
Amy D's user avatar
  • 581
7 votes
1 answer
50k views

In my script I have a function inside a module which I wish to be able to use in my main module to prevent redundancy. This other module (not my main, let's call it two.py) contains several classes ...
user2497792's user avatar
12 votes
3 answers
8k views

So, I've seen a few similar questions on Stack Overflow, but nothing seems to address my issue, or the general case. So, hopefully this question fixes that, and stops my headaches. I have a git repo ...
Eli's user avatar
  • 39.3k
5 votes
5 answers
16k views

I am new to Python. This really confused me! My directory structure is like this: Project | - subpackage1 |- a.py | - subpackage2 |- b.py | - c.py When I import ...

15 30 50 per page
1
2 3 4 5 6