Add a New Comment (Rich Markup)
The main problem it can create is that it will mean stuff installed in the virtualenv only will not be found when you try to import it. It's simple to prove. 1. Setup a virtualenv 2. Activate that virtualenv 3. Install pybuffer.py in python/autoload 4. Run weechat-curses 5. Create a pybuffer (/pybuffer) 6. Try to import your module. This will fail because PYTHONPATH is incorrect for the python instance you are running. You can confirm that you are running the virtualenv'd instance by doing: import sys print sys.executable Actually this points to a wider issue with the Python plugin implementation. When you build your python extension loader you hard-link it to a specific version of Python but it is not obvious to the user which version of Python that is. Experienced developers will probably be able to figure these kinds of issues out but its fairly non-intuitive.
Hi, What kind of problems could that cause? Do you know a way to see the problem, maybe by writing a script? Or if you know how to fix, a patch would be welcome, if you can write one (and it must be compatible with Python 3.x, since now the devel version supports both Python 2.x and 3.x).
The sys.path variable in a wee-chat python plugin is incorrect: this is because you use "python_path = PySys_GetObject ("path");" to get the original value but this will not take into account the extra directories added by virtualenv. It would probably be better to use the output from "python -c 'import sys; print sys.path'" to determine the original value because that will take into account virtualenv environmental settings.
(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)
Attach Files: Comment:
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Only logged-in users can vote.
Please enter the title of George Orwell's famous dystopian book (it's a date):
Follow 4 latest changes.
Copyright © 2023 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Source Code
Powered by Savane 3.11