By installing it in a location that is listed earlier in sys.path
.
The directory your project is in, for example, is always listed first in sys.path
and other packages in the same directory will be found before system locations. In other words, put pyzmq
in the same folder as your script and it'll Just Work.
You can also add entries to sys.path
by listing them in the PYTHONPATH
environment variable; these will be inserted into sys.path
before system locations.