pydev

Eclipse-pydev, while trying to import sqlite3 im getting “Undefined variable from import: connect”

好久不见. 提交于 2019-12-11 02:03:46
问题 Eclipse version : Version: 3.8.1 import sqlite3 sqlite3.connect('database.db') print "Database connected successfully" in the above code, sqlite3.connect() is displayed as Undefined variable from import: connect But when i run the code it is running properly, why is that it is displayed as Error in eclipse-pydev? 回答1: I also faced the similar issue, solution is --> You need to add 'sqlite3' (without the quotatios) in the 'forced builtins' tab in Window>Preferences>PyDev>Python Interpreter

Eclipse unable to get info on the interpreter in virtual environment

大城市里の小女人 提交于 2019-12-11 01:39:21
问题 I'm on Mac OS X 10.8. Running Eclipse 4.2.2 with Pydev installed. I have a Django project that I run in a virtual environment for obvious reasons (libraries versioning etc.) When I attempt to point Eclipse to the interpreter 'python2.7' in the bin folder of the virtual environment, Eclipse spits out the error that it has failed to get info on the interpreter. Either it's unsupported (it is 2.7 so we're fine there) or it's an invalid interpreter (but I'm pointing to the alias). Any ideas what

How do I get rid of the Eclipse Find/Replace Bar

吃可爱长大的小学妹 提交于 2019-12-11 01:03:43
问题 For searching a document, I like using the floating Find/Replace window that pops up. Lately, however, hitting command - F pulls up this Find/Replace bar at the bottom of the editor window. I suppose I wouldn't mind it so much, except instead of selecting the text to search it puts the insertion point after whatever I've searched for before. Very annoying. Clicking on the magnifying glass pops up the other Find/Replace dialog. How can I get the normal dialog to pop-up by default? I should add

Django in Pydev spawns multiple processes?

泄露秘密 提交于 2019-12-11 00:45:45
问题 I have my project setup in PyDev in Eclipse. Whenever I debug my project, things go great, but once I try to restart the Django server, it spawns an additional runserver process, blocking up the port I'm using for the server ( 8000 ). Is there a workaround to make sure it really kills the server? 回答1: Django reloads the server each time changes are made to any Python code (running another instance of the server and killing the old one). It seems that it's not handled properly when launched

Creation of Windows executable file (*.exe) with PyDev-Eclipse and CDT-Eclipse — How?

混江龙づ霸主 提交于 2019-12-11 00:34:16
问题 Is it possible to create Windows executable files for Python and C/C++ code within the Eclipse workbench? If yes, then how can this be done? 回答1: This is how I create .exe files from eclipse, in windows. Is not within the eclipse workbench but it might help you. To avoid problems, I would recommend to download everything for 32 bit even if you use 64 bit computer. Install python 2.6 Install Eclipse Install py2exe In eclipse go to Help > Install new software and install pydev plugin from http:

Eclipse + PyDev: Eclipse telling me that this is an invalid import?

这一生的挚爱 提交于 2019-12-11 00:14:59
问题 I recently installed twython, a really sleek and awesome twitter API wrapper for Python. I installed it and it works fine from the interpreter, but when I try to import it via Eclipse, it says that twython is an invalid import. How do I "tell" eclipse where twython is so that it will let me import and use it? 回答1: I believe I have had this problem before - try going into the menu: Window_Preferences and then select Pydev and Interpreter-Python. Then try to click Auto-config - it should update

Importing using pydev and .pth files

荒凉一梦 提交于 2019-12-10 23:15:44
问题 related to: Unresolved Import Issues with PyDev and Eclipse Recently I moved my django package to django_trunk so I can have a development version elsewhere. I have no issue importing django, runserver, or any of that. My issue (annoyance?) is that all of the imports are coming up as underscored red indicating an error. Pydev clearly knows of the imports, but for whatever reason it still imports as red. I've noticed this with a few other packages, which use a .pth file instead of a direct

Python multiprocessing pipe will not recv() properly

谁说胖子不能爱 提交于 2019-12-10 22:42:18
问题 This is for Python 3.2.2. I'm only just learning how Python and multiprocessing work and this simple example has been tripping me: from multiprocessing import Pipe, Process def f(r): print(r.recv()) if __name__ == '__main__': q, r = Pipe() p = Process(target=f, args=(r,)) p.start() q.send([42, None, 'hello']) p.join() The main thread creates a new Process , p , and sends r , a bidirectional connection object, to function f() . When process p is started, I expect r.recv() to block (which, as

How to turn off Pydev indentation warnings for certain .py files

独自空忆成欢 提交于 2019-12-10 21:26:55
问题 I have some files in my project that are from an external source and that I never edit but sometimes step through. These files use a different indentation style from my default one (2 spaces vs. 4 spaces), and I currently many indentation warnings on them. Is there an easy way to suppress these warnings (or alternatively, specify an indentation style) on a file by file basis? I would expect to be able to solve my problem with the equivalent of a pragma line that I add at the top of the file

Installing Pydev for Eclipse throws error

心已入冬 提交于 2019-12-10 20:55:30
问题 I installed Eclipse. After which I started Eclipse clicked on menu Help -> Install New software and entered the Pydev repositories. I clicked the Pydev for Eclipse from the list of software and clicked "Next". Eclipse displayed the license information at which point I accepted the terms and clicked "Next". During install I got the following error. An error occurred while collecting items to be installed session context was:(profile=PlatformProfile, phase=org.eclipse.equinox.internal.p2.engine