packages

`del` on a package has some kind of memory

`del` on a package has some kind of memory Question: del seems to have some memory which puzzles me. See the following: In [1]: import math In [2]: math.cos(0) Out[2]: 1.0 In [3]: del math.cos In [4]: math.cos(0) ————————————————————————— AttributeError Traceback (most recent call last) <ipython-input-4-9cdcc157d079> in <module>() —-> 1 math.cos(0) AttributeError: module ‘math’ has …

Total answers: 3

How to pass arguments to main function within Python module?

How to pass arguments to main function within Python module? Question: I have recently started learning more about Python Packages and Modules. I’m currently busy updating my existing modules so that that can be run as script or imported as a module into my other code. I’m not sure how to construct my input arguments …

Total answers: 1

"ValueError: unknown locale: UTF-8" when importing pandas in python 2.7

"ValueError: unknown locale: UTF-8" when importing pandas in python 2.7 Question: I’m very new in python and would like to learn using pandas, but I can’t even use the package properly in my python. In the terminal I tried $ conda install pandas The result is: Fetching package metadata ……. Solving package specifications: ………. # …

Total answers: 1

Install Python package: "Package missing in current win-64 channels"

Install Python package: "Package missing in current win-64 channels" Question: I want to install GSEApy on Anaconda (I use 64bit Windows 10). https://bioconda.github.io/recipes/gseapy/README.html https://anaconda.org/bioconda/gseapy But I get this error: C:Windowssystem32>conda install gseapy Using Anaconda Cloud api site https:// api.anaconda.org Fetching package metadata ……….. Solving package specifications: . Error: Package missing in current win-64 channels: – …

Total answers: 4

jupyter notebook running kernel in different env

jupyter notebook running kernel in different env Question: I’ve gotten myself into some kind of horrible virtualenv mess. Help?! I manage environments with conda. Until recently, I only had a python2 jupyter notebook kernel, but I decided to drag myself kicking and screaming into the 21st century and installed a python3 kernel; I forget how …

Total answers: 7

How to install Python packages from the tar.gz file without using pip install

How to install Python packages from the tar.gz file without using pip install Question: Long story short my work computer has network constraints which means trying to use pip install in cmd just leads to timing out/not finding package errors. For example; when I try to pip install seaborn: Instead I have tried to download …

Total answers: 7

__init__.py can't find local modules

__init__.py can't find local modules Question: Borrowing a simplified example at http://pythoncentral.io/how-to-create-a-python-package/ I have an analogous file structure as follows, where Mammals.py and Birds.py define classes with the same names: Project/ Animals/ __init__.py Mammals.py Birds.py When running an ipython interpreter within the Project/ directory and with __init__.py being empty, the following works: from Animals.Mammals import …

Total answers: 2

Python can't find my module

Python can't find my module Question: I have a python project (which I run within a virtualenv) and that has the following structure: Project ├───.git ├───venv └───src ├───__init__.py ├───mymodules │ ├───__init__.py │ ├───module1.py │ └───module2.py └───scripts ├───__init__.py └───script.py script.py import src.mymodules.module1 … I run the project with venv activated and from the Project directory using …

Total answers: 4

Upgrade python packages from requirements.txt using pip command

Upgrade python packages from requirements.txt using pip command Question: How do I upgrade all my python packages from requirements.txt file using pip command? tried with below command $ pip install –upgrade -r requirements.txt Since, the python packages are suffixed with the version number (Django==1.5.1) they don’t seem to upgrade. Is there any better approach than …

Total answers: 16

Making an executable in Cython

Making an executable in Cython Question: Been playing with cython. Normally program in Python, but used C in a previous life. I can’t figure out how to make a free-standing executable. I’ve downloaded cython, and I can make a .pyx file (that’s just a normal Python file with a .pyx extension), that executes in the …

Total answers: 4