New package in standalone program

Hello,
I use Psychopy v2020.1.3 coder and i would like to use an external package (GitHub - qualisys/qualisys_python_sdk: Python implementation of the real-time protocol for Qualisys Track Manager) with the coder. I use preference /general and write in the path: [‘C:/anaconda/envs/PsychoEnv/lib/site-packages/qtm’,] which is the place the qtm module has been installed with conda.
However when i try to import qtm in my script, i have an error:

import qtm
ModuleNotFoundError: No module named ‘qtm’

Any idea?
Thanks

Standalone comes with its own python environment, and it’s buried in a weird place sometimes. What OS are you on?

Hello,
I’am on windows 10!
Thanks!

On Windows, the standalone pulls its packages from Program Files(x86)\PsychoPy3\Lib\site-packages\

Installing the module there should work.

Just installing the package there is not enough. You’ll have to add the module to the path of Psychopy.

Here is a link to a guide on how to do that.

Thanks!
i 'll try this.

Hello,
i put the package in the right place and it’s ok but now i have a problem with the asyncio package.
My script works with PsychoPy installed in manual mode with anaconda, the python version is 3.8. I would like to run my program with the standalone PsychoPy because i work with people working with the standalone PsychoPy version. My error is:

Blockquote
"AttributeError: module ‘asyncio’ has no attribute ‘create_task’

Any idea ?
Thanks

Hi @jeanJ,

I don’t quite understand your problem. So everything worked in Anaconda, but now you’re trying to get it to work in the standalone version and the error came up just there, right?

The asyncio package should be part of the standalone psychopy installation. Could you post the entire error message? Perhaps there is more information in it that could help identify the problem.

In the documentation for asynchio, it says that the create_task function was only added in Python 3.7.
What version of Psychopy are you using?

My standalone installation runs on Python 3.6. Therefore, it could not have the asynchio.create_task function installed. Do you use the asynchio package in your own scripts and might have used the function?

Hi everybody,
@LukasPsy, you are right, i use the asynchio create task function only available in python 3.7 and the latest standalone PsychoPy seems to use python 3.6. So, i have to find a way in order to work with python 3.6.
Thanks!

@LukasPsy, problem solved thanks!
In the python 's documentation about asyncio.create_task:

Blockquote
This function has been added in Python 3.7 . Prior to Python 3.7, the low-level asyncio.ensure_future() function can be used instead

So i replace asyncio.create_task with asyncio.ensure_future and that’s work!
Thanks!