I have a project folder that is a git repository (has a .git folder). When I use the command pip freeze, pip tries to use git. However, I don't have git installed on my system so this causes an error:
(env) PS C:\Users\eclaird\work\myproject> pip freeze
Cannot find command 'git'
Storing complete log in C:\Users\eclaird\pip\pip.log
(env) PS C:\Users\eclaird\work\myproject>
pip.log:
------------------------------------------------------------
C:\Users\eclaird\work\env\Scripts\pip-script.py run on 01/09/14 11:54:42
Cannot find command 'git'
Exception information:
Traceback (most recent call last):
File "C:\Users\eclaird\work\env\lib\site-packages\pip\basecommand.py", line 134, in main
status = self.run(options, args)
File "C:\Users\eclaird\work\env\lib\site-packages\pip\commands\freeze.py", line 73, in run
req = pip.FrozenRequirement.from_dist(dist, dependency_links, find_tags=find_tags)
File "C:\Users\eclaird\work\env\lib\site-packages\pip\__init__.py", line 180, in from_dist
req = get_src_requirement(dist, location, find_tags)
File "C:\Users\eclaird\work\env\lib\site-packages\pip\vcs\__init__.py", line 249, in get_src_requirement
return version_control().get_src_requirement(dist, location, find_tags)
File "C:\Users\eclaird\work\env\lib\site-packages\pip\vcs\git.py", line 151, in get_src_requirement
repo = self.get_url(location)
File "C:\Users\eclaird\work\env\lib\site-packages\pip\vcs\git.py", line 122, in get_url
[self.cmd, 'config', 'remote.origin.url'],
File "C:\Users\eclaird\work\env\lib\site-packages\pip\vcs\__init__.py", line 110, in cmd
command = find_command(self.name)
File "C:\Users\eclaird\work\env\lib\site-packages\pip\util.py", line 108, in find_command
raise BadCommand('Cannot find command %r' % cmd)
BadCommand: Cannot find command 'git'
Is there a way to disable the git integration in pip?
(pip 1.4.1,
Python 2.7.6)
Unfortunately, no. There is no config option to enable/disable backends.
Details, found by digging in the code:
Git module is always registered: In pip/install.py, the git module is imported. At the end of it, it registers itself, and will thus be queried whenever one of the schemes declared in ´git.Git´ matches the url of the dependency.
schemes = ('git', 'git+http', 'git+https', 'git+ssh', 'git+git', 'git+file')
Exception is not handled Funnily, freezing anticipates that an error might occur when determining the dependency url to be frozen. Excerpt from pip.FrozenRequirement:
try:
req = get_src_requirement(dist, location, find_tags)
except InstallationError:
logger.warn("Error when trying to get requirement for VCS system %s, falling back to uneditable format" % ex)
InstallationError inherits from PipError. Unfortunately, an exception of type ´BadCommand´ is raised, which inherits from ´PipError´.
So, aside from hacking the source: Nothing you can do. If you need this to work, you need to install git, hack the source, or simulate a git executable. If you go for the latter, for starters you need to fake ´git config remote.origin.url´, which is called (and fails) in pip.vcs.git.Git.get_url.
Hope that helps, even though it's not a yes. ;)
Related
I have the edx-platform, ecommerce, ecommerce-themes, credentials and edx-theme directories. I have installed successfully tutor and devstack but I didn't find the way to replace these custom directories. So, what is the correct way to replace them ?
After devstack runned successfully, I tried replacing the default directories with the custom ones but when I runned make dev.provision I get this output
+ docker-compose exec -T lms bash -e -c 'source /edx/app/edxapp/edxapp_env && cd /edx/app/edxapp/edx-platform && NO_PYTHON_UNINSTALL=1 paver install_prereqs'
/edx/app/edxapp/edxapp_env: line 13: manpath: command not found
---> pavelib.prereqs.install_prereqs
---> pavelib.prereqs.install_node_prereqs
npm install error detected. Retrying...
Captured Task Output:
---------------------
---> pavelib.prereqs.install_prereqs
---> pavelib.prereqs.install_node_prereqs
Traceback (most recent call last):
File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/paver/tasks.py", line 201, in _run_task
return do_task()
File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/paver/tasks.py", line 198, in do_task
return func(**kw)
File "/edx/app/edxapp/edx-platform/pavelib/utils/timer.py", line 40, in timed
return wrapped(*args, **kwargs)
File "/edx/app/edxapp/edx-platform/pavelib/prereqs.py", line 332, in install_prereqs
install_node_prereqs()
File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/paver/tasks.py", line 333, in __call__
retval = environment._run_task(self.name, self.needs, self.func)
File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/paver/tasks.py", line 219, in _run_task
return do_task()
File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/paver/tasks.py", line 198, in do_task
return func(**kw)
File "/edx/app/edxapp/edx-platform/pavelib/utils/timer.py", line 40, in timed
return wrapped(*args, **kwargs)
File "/edx/app/edxapp/edx-platform/pavelib/prereqs.py", line 184, in install_node_prereqs
prereq_cache("Node prereqs", ["package.json"], node_prereqs_installation)
File "/edx/app/edxapp/edx-platform/pavelib/prereqs.py", line 111, in prereq_cache
install_func()
File "/edx/app/edxapp/edx-platform/pavelib/prereqs.py", line 154, in node_prereqs_installation
raise Exception("npm install failed: See {}".format(npm_log_file_path))
Exception: npm install failed: See /edx/app/edxapp/edx-platform/test_root/log/npm-install.log
make[1]: *** [Makefile:217: impl-dev.provision] Error 1
make[1]: Leaving directory '/home/pablo/Documents/prueba/devstack'
Would you like to assist devstack development by sending anonymous usage metrics to edX? Run `make metrics-opt-in` to learn more!
make: *** [Makefile:221: dev.provision] Error 2
EDIT
The directories that I have after run make dev.provision and make dev.up with the default project of devstack, are the following ones:
Directories of default project devstack openedx
The thing that I tried was replace the default directories with the custom directories (open-edx-platform, ecommerce, ..., etc).
If you look at your log, you'll see the following error:
/edx/app/edxapp/edxapp_env: line 13: manpath: command not found
This suggests (guessing here!) you're missing man. So try installing it, e.g.:
apt install man
Others have reported similar kinds of errors when using nvm, e.g. see here
It seems the npm install is failing.
I don't know if you already have node & npm installed but you could try installing it, and see what the result is afterwards.
sudo apt update
sudo apt install nodejs npm
If you posted the npm log file, it would help a lot. You should be able to find it, per the source code, in the directory specified by the environment variable GEN_LOG_DIR:
{Env.GEN_LOG_DIR}/npm-install.log'
Deploying a security patch to a production machine today and zc.buildout just
randomly breaks. I already tried to upgrade pip and this still doesn't resolve the issue.
$ ./bin/buildout
mr.developer: Queued 'django-appregister' for checkout.
mr.developer: Queued 'django-countries' for checkout.
mr.developer: Queued 'django-mailer' for checkout.
mr.developer: Queued 'django-ostinato' for checkout.
mr.developer: Skipped checkout of existing package 'django-appregister'.
mr.developer: Skipped checkout of existing package 'django-countries'.
mr.developer: Skipped checkout of existing package 'django-mailer'.
mr.developer: Skipped checkout of existing package 'django-ostinato'.
Develop: '/home/evopoints/webapp/src/django-ostinato'
/usr/lib/python2.7/dist-packages/setuptools/dist.py:364: UserWarning: Normalizing '1.1.beta' to '1.1b0'
normalized_version,
warning: no previously-included files matching '*.pyc' found anywhere in distribution
Develop: '/home/evopoints/webapp/src/django-mailer'
Develop: '/home/evopoints/webapp/src/django-countries'
Develop: '/home/evopoints/webapp/src/django-appregister'
/usr/lib/python2.7/dist-packages/setuptools/dist.py:364: UserWarning: Normalizing '0.4.dev' to '0.4.dev0'
normalized_version,
Unused options for buildout: 'include-site-packages' 'unzip'.
Updating _mr.developer.
Installing python.
While:
Installing python.
An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/home/evopoints/webapp/eggs/zc.buildout-2.9.4-py2.7.egg/zc/buildout/buildout.py", line 2123, in main
getattr(buildout, command)(args)
File "/home/evopoints/webapp/eggs/zc.buildout-2.9.4-py2.7.egg/zc/buildout/buildout.py", line 796, in install
installed_files = self[part]._call(recipe.install)
File "/home/evopoints/webapp/eggs/zc.buildout-2.9.4-py2.7.egg/zc/buildout/buildout.py", line 1553, in _call
return f()
File "/home/evopoints/webapp/eggs/zc.recipe.egg-2.0.3-py2.7.egg/zc/recipe/egg/egg.py", line 126, in install
reqs, ws = self.working_set()
File "/home/evopoints/webapp/eggs/zc.recipe.egg-2.0.3-py2.7.egg/zc/recipe/egg/egg.py", line 84, in working_set
allow_hosts=self.allow_hosts)
File "/home/evopoints/webapp/eggs/zc.buildout-2.9.4-py2.7.egg/zc/buildout/easy_install.py", line 913, in install
return installer.install(specs, working_set)
File "/home/evopoints/webapp/eggs/zc.buildout-2.9.4-py2.7.egg/zc/buildout/easy_install.py", line 657, in install
for spec in specs]
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2879, in parse
req, = parse_requirements(s)
ValueError: need more than 0 values to unpack
Why does this happen at random times? (It's not the first time)
This is now at the point that I'm going to have to move away from buildout
entirely, because it's too unreliable, for a client production site to randomly
fail during a small patch in he's site code.
If you run buildout with -vvvv, you might see the actual error.
The "need more than 0 values to unpack" error, in my experience, sometimes occurs when there's an error downloading something.
What could also help is to upgrade your versions of setuptools and zc.buildout (2.12.0 is out, you're using 2.9.4). There have been quite a number of fixes to buildout to compensate for changes in the environment (most often changes in setuptools).
Note that pypi also moved. From http to https, and from pypi.python.org to pypi.org. So adjusting your index= line (if you have it) might save a bunch of redirects, which could also work.
I haven't seen any serious breakage in buildout in the last few months, at least the github issue tracker has been quiet :-)
Changing interpreter option to python2.7 from python helped me in similar situation:
[buildout]
parts =
python
[python]
# ...
interpreter = python2.7
I am trying to use the python 3 bindings to VirtualBox but there appears to be broken dependencies. It seems odd to me that this hasn't been fixed over the ~4 years that people have been having this issue. Perhaps I'm missing something obvious. It's been known to happen.
I have installed the virtualbox host modules, sdk, and extensions through my OS's pacakage manager. Then, through pip:
pip install pyvbox
The imports work:
from virtualbox import VirtualBox, Session, Manager, WebServiceManager
But then any attempt to instantiate anything results in an exception complaining about a missing vboxapi.
box = VirtualBox()
Traceback:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/usr/lib/python3.6/site-packages/virtualbox/library_ext/vbox.py", line 22, in __init__
manager = virtualbox.Manager()
File "/usr/lib/python3.6/site-packages/virtualbox/__init__.py", line 130, in __init__
with import_vboxapi() as vboxapi:
File "/usr/lib/python3.6/contextlib.py", line 82, in __enter__
return next(self.gen)
File "/usr/lib/python3.6/site-packages/virtualbox/__init__.py", line 45, in import_vboxapi
import vboxapi
File "/home/$USER/.eclipse/org.eclipse.platform_4.6.3_155965261_linux_gtk_x86_64/plugins/org.python.pydev_5.7.0.201704111357/pysrc/_pydev_bundle/pydev_import_hook.py", line 20, in do_import
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'vboxapi'
There is a vboxapi on PyPi, but it won't install as there is no code associated with it, nor any useful information on the PyPi page:
https://pypi.python.org/pypi/vboxapi
Here are a couple links to the valiant efforts of braver souls than I. It is not immediately clear to me which is the correct solution or if either are still relevant, given that they are from 3 and 4 years ago, respectively.
https://github.com/GreatFruitOmsk/vboxapi-py3
https://github.com/jbuergel/vboxapi-py3
Also from 3 years ago, word of a vboxapi.diff and intergration into vboxapi:
https://www.virtualbox.org/pipermail/vbox-dev/2014-April/012231.html
I'm the current maintainer of the pyvbox package.
The VirtualBox SDK already supports Python 3, I use Python 3.5 to develop the library. I recommend uninstalling and reinstalling the latest version of the SDK (which at the time of writing this is 5.1.22).
You can find the SDK on the VirtualBox downloads page. Unzip the archive and run the vboxapisetup.py file using your system Python with the following command:
python vboxapisetup.py install
You don't need to install this in any virtualenv, as pyvbox will search your system libraries in addition to virtualenv installations for better ease of use.
If you have problems using the pyvbox package after running these steps, please open an issue and include as much information as possible including the steps you took, OS, where your system Python is located, which version of VirtualBox & SDK you're using, and I'll help you as best I can.
Yes you can, it is possible, very tricky to setup but it work fine for me now (Ubuntu 18.04 / python3.6 / virtualbox 6.0) .
The error:
ModuleNotFoundError: No module named 'vboxapi'
mean that python3 does not find vboxapi module, now there is two methods to "force-install" the vboxapi package to python3:
First Method [easy]: Assuming pyvbox is already installed and work fine with python2.7, in that case you can simply copy the package from python2.7 dist-packages to python3 dist-package with:
sudo cp -r /usr/lib/python2.7/dist-packages/vboxapi /usr/lib/python3/dist-packages
Second method [more tricky]: Go to VirtualBox, then download the last Software Developer Kit (SDK), actually the 6.0.4
Unzip the archive and run the vboxapisetup.py file using Python3 with the following command:
sudo python3 vboxapisetup.py install
You will get this issue:
Traceback (most recent call last):
File "vboxapisetup.py", line 90, in <module>
main(sys.argv)
File "vboxapisetup.py", line 63, in main
raise Exception("No VBOX_INSTALL_PATH defined, exiting")
Exception: No VBOX_INSTALL_PATH defined, exiting
You may directly edit the current file vboxapisetup.py and replace line 57, from vboxDest = os.environ.get("VBOX_MSI_INSTALL_PATH", None) to vboxDest = "/usr/lib/virtualbox"
Then run agin:
sudo python3 vboxapisetup.py install
And now you will get something like that:
running install
running build
running build_py
copying vboxapi/__init__.py -> build/lib/vboxapi
running install_lib
creating /usr/local/lib/python3.6/dist-packages/vboxapi
copying build/lib/vboxapi/__init__.py -> /usr/local/lib/python3.6/dist-packages/vboxapi
copying build/lib/vboxapi/VirtualBox_constants.py -> /usr/local/lib/python3.6/dist-packages/vboxapi
byte-compiling /usr/local/lib/python3.6/dist-packages/vboxapi/__init__.py to __init__.cpython-36.pyc
byte-compiling /usr/local/lib/python3.6/dist-packages/vboxapi/VirtualBox_constants.py to VirtualBox_constants.cpython-36.pyc
running install_egg_info
Removing /usr/local/lib/python3.6/dist-packages/vboxapi-1.0.egg-info
Writing /usr/local/lib/python3.6/dist-packages/vboxapi-1.0.egg-info
which mean that we are ok with vboxapi package installation !
Now, let's try again to load virtualbox() inside python3:
from virtualbox import VirtualBox, Session, Manager, WebServiceManager
box = VirtualBox()
this probably will raise this new issue:
Traceback (most recent call last):
File "virtualbox_python3_test.py", line XX, in <module>
vbox = virtualbox.VirtualBox()
File "/usr/local/lib/python3.6/dist-packages/virtualbox/library_ext/vbox.py", line 22, in __init__
manager = virtualbox.Manager()
File "/usr/local/lib/python3.6/dist-packages/virtualbox/__init__.py", line 143, in __init__
self.manager = vboxapi.VirtualBoxManager(mtype, mparams)
File "/usr/local/lib/python3.6/dist-packages/vboxapi/__init__.py", line 989, in __init__
self.platform = PlatformXPCOM(dPlatformParams)
File "/usr/local/lib/python3.6/dist-packages/vboxapi/__init__.py", line 750, in __init__
import xpcom.vboxxpcom
File "/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/vboxxpcom.py", line 78, in <module>
raise Exception('Cannot find VBoxPython module (tried: %s)' % (', '.join(_asVBoxPythons),))
Exception: Cannot find VBoxPython module (tried: VBoxPython3_6m, VBoxPython3m, VBoxPython)
If you dig you will find a lot of questions (question 1,question 2,question 3, question 4 etc...) relative to this issue on the web ...
But according to my dig & research, if you are lucky (and have a Virtualbox built with python3 native support) you can try:
cd /usr/lib/virtualbox/
sudo cp VBoxPython3_5m.so VBoxPython3_6m.so
But if you got the following error:
cp: cannot stat 'VBoxPython3_5m.so': No such file or directory
It mean that you don't have native python3 support in Virtualbox...
This could be solved like this:
Go here and download the python3-virtualbox-5.2.16 binary package (we don't care about the VirtualBox version...)
Now open python3-virtualbox-5.2.16-lp150.4.11.1.x86_64.rpm archive, browse it to /./usr/lib/virtualbox/, then extract the file VBoxPython3_6m.so, then drop this file in your current working directory, after that from this directory you have to do:
sudo cp VBoxPython3_6m.so /usr/lib/virtualbox/
And now, you can use python3 binding for virtualbox !
When I run the fully_connected_feed.py code:
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/tutorials/mnist/fully_connected_feed.py
I get an error:
Traceback (most recent call last):
File "C:/Users/AppData/Local/Continuum/Anaconda3/Lib/site-packages/tensorflow/examples/tutorials/mnist/fully_connected_feed.py", line 277, in <module>
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
File "C:\Users\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "C:/Users/AppData/Local/Continuum/Anaconda3/Lib/site-packages/tensorflow/examples/tutorials/mnist/fully_connected_feed.py", line 222, in main
run_training()
File "C:/Users/AppData/Local/Continuum/Anaconda3/Lib/site-packages/tensorflow/examples/tutorials/mnist/fully_connected_feed.py", line 120, in run_training
data_sets = input_data.read_data_sets(FLAGS.input_data_dir, FLAGS.fake_data)
File "C:\Users\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\contrib\learn\python\learn\datasets\mnist.py", line 211, in read_data_sets
SOURCE_URL + TRAIN_IMAGES)
File "C:\Users\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\contrib\learn\python\learn\datasets\base.py", line 142, in maybe_download
gfile.Copy(temp_file_name, filepath)
File "C:\Users\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 316, in copy
compat.as_bytes(oldpath), compat.as_bytes(newpath), overwrite, status)
File "C:\Users\AppData\Local\Continuum\Anaconda3\lib\contextlib.py", line 66, in __exit__
next(self.gen)
File "C:\Users\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 469, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.OutOfRangeError: Read fewer bytes than requested
How do I resolve this issue?
After doing the following, I was able to run the script without errors. The key for getting it to work for me, was the version of tensorflow installed has to match the tutorial code, otherwise there were exceptions. Although, I got a different exception than you, at first.
After installing tensorflow, check version. Details of this step may be different if you installed it pip or some other method:
$ conda list tensorflow
# packages in environment at /Users/agr/miniconda3/envs/tensorflow:
#
tensorflow 0.11.0 py35_0 conda-forge
Clone the git repo
$ git clone https://github.com/tensorflow/tensorflow.git
Inspect the tags available and checkout the release matching your install:
$ cd tensorflow
$ git tag -l -n1
...
$ git checkout v0.11.0
Run script!
$ cd examples/tutorials/mnist/
$ python fully_connected_feed.py
The key point being, run the script from here, not from the link you posted in the original question.
TL; DR
Something else is altering your files as you create them. Find the process and stop it.
Research
I've just run the demo with Windows 10, Python 3.5, tensorflow 0.12.0 with no errors. It is therefore something about your environment.
Looking at the actual line of the error, you are failing to read the required number of bytes from the open file. Going further up the stack you can see that CopyFile is actually trying to read all the bytes of a file into a string in this function. This starts by finding out the current file size and then trying to read all the bytes.
The problem is that the file size at the start of this process doesn't match the size by the end of the copy. In other words, something else has altered your file.
What next?
Your best bet is to try to find out what else is accessing your file. I suggest you use the techniques explained here to see what else has the file open as you are running the copy.
I encountered the same problem on Windows 2012 Server.
As suggested in the previous post, I downloaded and launched Process Monitor, then set the filter: "Path contains mnist" see the image. The datasets were downloaded and unpacked correctly, while running code both from Spyder and Jupyter.
I suspect that there is a race condition in the library code, i.e. missing synchronization between downloading and unpacking operations. As Process Monitor introduced additional delays, the datasets were sucessfully downloaded before the next operation started, hence the hazardous behavior was not observed.
I have a small rest api built in python using Falcon Framework and it runs in a virtual environment with gunicorn + gevent and pypy 2.3 (I successfully installed the pip packages from gevent#pypy-hacks and gevent-on-pypy/pypycore). I wanted to add a "supervisor" for my application so I first installed supervisord and followed the steps to get it up and running.
The first thing I did in the server was to test the command to start the api; it ran successfully and I could use the api without any issues. The command is:
/bin/bash -c 'cd /path/to/project/api && /path/to/project/env/bin/gunicorn -c settings.py my-api:my_api'
Note: in settings.py I set the parameter daemon=False since I saw that supervisors require that the commands are run in the "foreground" and not daemonized.
Once that was working, I went ahead and created the app's /etc/supervisor/conf.d/my_api.conf conf file with the "command" parameter set as the command above I ran successfully. When I tried to start the api through supervisord, it failed, and in the log of the api, the error was:
Traceback (most recent call last):
File "/path/to/project/env/site-packages/gunicorn/arbiter.py", line 507, in spawn_worker
worker.init_process()
File "/path/to/project/env/site-packages/gunicorn/workers/ggevent.py", line 185, in init_process
self.patch()
File "/path/to/project/env/site-packages/gunicorn/workers/ggevent.py", line 74, in patch
_sock=s))
File "/path/to/project/env/site-packages/gevent/socket.py", line 240, in __init__
self.hub = get_hub()
File "/path/to/project/env/site-packages/gevent/hub.py", line 169, in get_hub
hub = _threadlocal.hub = hubtype(*args, **kwargs)
File "/path/to/project/env/site-packages/gevent/hub.py", line 268, in __init__
loop_class = _import(self.loop_class)
File "/path/to/project/env/site-packages/gevent/hub.py", line 198, in _import
return _import(path[-1])
File "/path/to/project/env/site-packages/gevent/hub.py", line 210, in _import
x = __import__(module)
ImportError: No module named gevent.core
So, I was surprised that running the command manually did work, but when supervisor tried to run it, the above error was thrown.
After lots of trial and errors, I decided to install monit to see if it could monitor my api, and I did set it up successfully specifying the "start program" parameter as the aforementioned command.
I was surprised that monit throwed the exact same error. So, does this mean that the nature of my api (pypy + gunicorn + gevent) prevents itself from being monitored by any monitor software around there?
Is there something I'm doing wrong when configuring supervisord/monit?
Any help is greatly appreciated.
Turns out that I have the environment var GEVENT_LOOP already exported in my /etc/environment as follows:
export GEVENT_LOOP=pypycore.loop
Since for running gevent on pypy some hacks are needed including the above export.
But I needed to export it manually in the 'start_program' command entry of Monit (at the end I sticked with Monit), so the resulting command is:
/bin/bash -c 'cd /path/to/project/api && export GEVENT_LOOP=pypycore.loop && /path/to/project/env/bin/gunicorn -c settings.py my-api:my_api'