pythonpath

Add the current project to the python path with Komodo Edit

我的未来我决定 提交于 2019-12-11 05:15:24
问题 Ive been using komodo edit recently to go through a few django tutorials, and ive been impressed with the level of code completion it provides for the framework. However what i really want it to do is provide code completion for the current project, so in effect my own views, models etc. would work in the same way as the framework itself. Is there a way to temporarily modify the python path on a per project basis to get code completion of my current project? NB: Im not sure whether this is a

Including Git submodules on pythonpath when using virtualenv

吃可爱长大的小学妹 提交于 2019-12-11 02:56:49
问题 I'm using Git for version control on a Django project. As much as possible, all the source-code that is not part of the project per se, but that the project depends on, is brought in as Git submodules. These live on a lib directory and have to be included on python path. The directory/files layout looks like: .git docs lib my_project apps static templates __init__.py urls.py manage.py settings.py .gitmodules README What, would you say, is the best practice for including the libs on python

Gunicorn+Django+Heroku. Python Path Issue

与世无争的帅哥 提交于 2019-12-11 02:16:52
问题 I'm running a Django app that I used to deploy to Heroku with Gunicorn without a hitch. By that I mean that I could run foreman start on my localhost and be able to understand whether the application would work in the production environment. I recently made the decision to move all of our project's applications into a subfolder named 'applications'. This meant editing my DJANGO_SETTINGS_MODULE environment variable among other files. After doing this, I experimented with foreman and gunicorn

Python's 'site.py' gone after Yosemite upgrade. Is that okay?

陌路散爱 提交于 2019-12-09 23:37:40
问题 The Yosemite (OS X 10.10) upgrade includes Python 2.7.6, and the process, as usual with Apple system updates, seems to completely replace the system packages directory, in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python This time, the process appears to have entirely omitted site.py. My understanding was that this file was essential to the functioning of Python, in particular, the proper construction of package search paths; but my Python (which uses nothing more

Add directory to Python path in PyCharm?

可紊 提交于 2019-12-09 14:21:50
问题 I want to be able to use the paraview.simple library in PyCharm. I already have paraview installed in my computer. This package cannot be installed with pip and there are no .whl files as far as I can tell. The website docs recommend that the directory containing all the python files be added to PYTHONPATH. How do I add the relevant folder in PYTHONPATH on my PyCharm session, and keep it there by default, such that when I close out and reopen the paraview.simple library is still available?

scrapy cannot import module while it's in my pythonpath

家住魔仙堡 提交于 2019-12-08 06:40:16
问题 I had a functional scrapy project, and then I decided to clean it. In order to do so, I got my database module out of the scrapy part of my project and I can't include it anymore. Now the project looks like this : myProject/ database/ __init__.py model.py databaseFactory.py myScrapy/ __init__.py settings.py myScrapy/ __init__.py pipeline.py spiders/ spiderA.py spiderB.py api/ __init__.py config/ __init__.py (only files related to my question are displayed) I want to use the databaseFactory in

pylint import and dynamic path modification

元气小坏坏 提交于 2019-12-08 04:42:44
问题 My projects are generally structured like this: projectname/ __init__.py python/ mymodule.py other_stuff/ more_stuff/ where __init__.py contains the following code import os mypath = os.path.dirname(os.path.realpath(os.path.abspath(__file__))) __path__ = [mypath, mypath+"/python"] This "skips" the python directory when importing to allow python code in the form from projectname import mymodule rather than from projectname.python import mymodule . This appears to break pylint however, being

Python: deletion of item in sys.path is undone each time I restart the interpreter

懵懂的女人 提交于 2019-12-08 02:01:38
问题 >>> sys.path[6] /path/to/django >>> sys.path.pop(6) /path/to/django Then CTRL + D $ python >>> sys.path[6] /path/to/django O dear... 回答1: sys.path is populated from the externally maintained PYTHONPATH variable. Change this variable to get a permanent change when you restart python. On unix (including Macs) when using bash it's configured most likely like this: export PYTHONPATH=.... And this statement is most likely hiding in your .profile or .bashrc file. To do this in Windows you need to

Importing from another directory

懵懂的女人 提交于 2019-12-07 14:31:59
问题 I am structuring my Python application with the following folder architecture (roughly following the outline here): myapp: myapp_service1: myapp_service1_start.py ... myapp_service2: myapp_service2_start.py ... myapp_service3: myapp_service3_start.py ... common: myapp_common1.py myapp_common2.py myapp_common3.py ... scripts: script1.py script2.py script3.py ... tests: ... docs: ... LICENSE.txt MANIFEST.in README This is ideal file/folder hierarchy for me, however, I am confused on how to

How to setup python path for 2.7 on mac?

纵然是瞬间 提交于 2019-12-07 07:46:19
问题 I am aware that, this question has been asked and answered many times. But, still i couldn't get rid of this. I found out the following info on my mac. cd /Library/Frameworks/Python.framework/Versions/ Current -> 2.7 3.6 whereispython /usr/bin/python which python /usr/bin/python which -a python /usr/bin/python /usr/bin/python python Python 2.7.10 (default) [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin Type "help", "copyright", "credits" or "license" for more information