I'm in the process of redesigning/refactoring my Python quantum chemistry package (pyquante). One of the things I don't like about the existing release is that I have to install the package to run the test suite. That is, the test suite has statements like from PyQuante import SCF
, and, of course, this PyQuante could refer to the installed version or a local version.
I know about virtualenv, and realize this is an option for me. But I was wondering whether anything else might be appropriate. In the past I've hacked sys.path
for things like this, and have been told by better Python programmers that I shouldn't ever to this.
Does anyone have any suggestions for how I can do this? The point is that I want to test the current version of the code without installing it.
Thanks in advance for anyone who can see through my babbling and offer suggestions!
If you are not able to install modules on a machine(due to not having enough permissions), you could use either virtualenv or save the module files in another directory and use the following code to allow Python to search for modules in the given module: >>> import os, sys >>> file_path = 'AdditionalModules/' >>> sys.
To install any python library without pip command, we can download the package from pypi.org in and run it's setup.py file using python. This will install the package on your system.
To check all the installed Python modules, we can use the following two commands with the 'pip': Using 'pip freeze' command. Using 'pip list command.
Create a proper package for your stuff and use
python setup.py develop
to make it a proper dev-package.
See:
I would honestly insist on using virtualenv, its designed for this exact reason in mind. very small overhead, and if you ever mess up just delete directory. I am sure as you grow, things won't be as simple as they are now for your current situation. Take it as an opportunity to learn.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With