[Twisted-Python] twistd script python path
![](https://secure.gravatar.com/avatar/5f4cd85b70efbbf1376f305ea16d9553.jpg?s=120&d=mm&r=g)
Hi, I'm trying to debug a memory leak in a twisted application and I’d like to use tracemalloc. Unfortunately, the application hasn’t been updated to python 3 so I have to patch python 2.7. Here’s my problem: After downloading and compiling python in /usr/local, I tried running my twisted application with the twistd in /usr/local, but it uses the python in /usr/bin. My question: How do I get twistd to use the python in /usr/local?
![](https://secure.gravatar.com/avatar/d37c7104c024b78dc451e3a6b733df9d.jpg?s=120&d=mm&r=g)
On Mar 27, 2018, at 3:32 PM, Paul Albrecht <palbrecht@glccom.com> wrote:
I'm trying to debug a memory leak in a twisted application and I’d like to use tracemalloc. Unfortunately, the application hasn’t been updated to python 3 so I have to patch python 2.7. Here’s my problem: After downloading and compiling python in /usr/local, I tried running my twisted application with the twistd in /usr/local, but it uses the python in /usr/bin. My question: How do I get twistd to use the python in /usr/local?
for this sort of stuff I just use a virtualenv created with an explicit python: something like this: iPood:~ jonathan$ virtualenv —python=/usr/local/python issue-debug-venv iPood:~ jonathan$ source issue-debug-venv/bin/activate (issue-debug-venv) iPoodd:~ jonathan$ pip install {{twisted version}} that should install a twistd into `issue-debug-venv/bin` which uses the specified virtualenv.
![](https://secure.gravatar.com/avatar/d37c7104c024b78dc451e3a6b733df9d.jpg?s=120&d=mm&r=g)
On Mar 27, 2018, at 3:32 PM, Paul Albrecht <palbrecht@glccom.com> wrote:
I'm trying to debug a memory leak in a twisted application and I’d like to use tracemalloc. Unfortunately, the application hasn’t been updated to python 3 so I have to patch python 2.7. Here’s my problem: After downloading and compiling python in /usr/local, I tried running my twisted application with the twistd in /usr/local, but it uses the python in /usr/bin. My question: How do I get twistd to use the python in /usr/local?
for this sort of stuff I just use a virtualenv created with an explicit python: something like this: iPood:~ jonathan$ virtualenv —python=/usr/local/python issue-debug-venv iPood:~ jonathan$ source issue-debug-venv/bin/activate (issue-debug-venv) iPoodd:~ jonathan$ pip install {{twisted version}} that should install a twistd into `issue-debug-venv/bin` which uses the specified virtualenv.
participants (2)
-
jonathan vanasco
-
Paul Albrecht