pipenv Locking Failed when installing QuantLib-Python - quantlib

I tried to create an environment in the folder quantengine (on my MacOS V.11.3 - Big Sur) by first installing the QuantLib-Python package. It seems to install, but I get the Locking Failed error. Any idea what might be causing this? I installed first pyenv via brew. I set Python 3.9.4 as global. I then installed pipenv via pip.
screenshot zsh shell

Related

Installing requirements with pip in an environment terminates (2.7)

I'm trying to setup my work environment on my new MBP M1. The executable is python2.7, so I've been trying to create a virtualenv and install the requirements.
Alas, I can not.
I create an environment, and get the output:
virtualenv env
created virtual environment CPython2.7.16.final.0-64 in 183ms
creator CPython2macOsFramework(dest=/Users/v/dev/skolplattformen/env, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, wheel=bundle, setuptools=bundle, via=copy, app_data_dir=/Users/v/Library/Application Support/virtualenv)
added seed packages: pip==20.3.3, setuptools==44.1.1, wheel==0.36.2
activators PythonActivator,CShellActivator,FishActivator,PowerShellActivator,BashActivator
Then I activate that environment, and try to pip install the requirements.
Although, I get this
1716 killed pip2.7 install -r requirements.txt
I can't find anything in system.log, I can't find what process 1716 is...
which pip2.7 points to the right place, although which pip, in the environment, says pip: aliased to noglob pip.
I can't execute a python script either in the environment, or open a repl, it gives the same kill message.
I had the same problem. I solved it by downloading Python 2.7 from https://www.python.org/ to replace the system's default.

In Windows 10, pip import error: cannot import name main after installing pipenv

I am trying to use pipenv as well as pip and having some issues. I installed pipenv using pip. I installed pipenv using pip. Then I went back and tried to run pip -v and got the following: ImportError: cannot import name main. I have seen this question answered for Linux and Mac, but I cannot use sudo or which commands; I am on Windows 10 using the CMD console. In my scripts folder, I see pip, pip2.7, and pip2. I cannot remember which one was my system pip. I know I need to maybe uninstall and reinstall (I have already tried to upgrade, but of course, without pip running you can't upgrade pip). I don't want to make more of a mess, so I wanted to ask how to resolve this in the CMD console on Windows.
Apparently, when I installed pipenv, it changed the system pip version that I was previously using. For some reason, all of the answers I found were using Linux or Mac, but here is how I resolved it. Simply open your command prompt and type:
$python -m pip uninstall pip
Then, test that you still have your old version installed by typing:
$pip -V
This showed me that I had gone from using pip version 18 back to using version 8.1.1. You should then be able to proceed to other tasks using pip.

Can't find any modules in Django project

I've been following a Django tutorial and initially created virtualenv and a requirements file in it. Project was halfway and in working state. Today I activated virtualenv successfully and tried python manage.py runserver to get error
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
I realized it's not finding Django and just to be sure checked my requirements.txt file (which confirmed right Django version). Tried to reinstall it from the file using pip3 install -r requirements.txt (tried using just pip too) to get another error --
ModuleNotFoundError: No module named 'pip'
It seems the environment is unable to find any of the modules. I tried to reinstall pip also just to be sure, but then it couldn't find apt-get command.
OS: Mac OSX El Capitan 10.11.6
Python: 3.6.2
Django: 1.10.3 (in requirements file)
Try running python -m ensurepip (or python3 -m ensurepip) to see if pip is already installed:
In most cases, end users of Python shouldn’t need to invoke this module directly (as pip should be bootstrapped by default), but it may be needed if installing pip was skipped when installing Python (or when creating a virtual environment) or after explicitly uninstalling pip.

Unable to get these to cooperate: mysql-python + virtualenv + percona + centos6

I've gone through many threads related to installing mysql-python in a virtualenv, including those specific to users of Percona. None have solved my problem thus far.
With Percona, it is normal to get a long error on pip install MySQL-python in the virtualenv that ultimately says EnvironmentError: mysql_config not found. One method to remedy this is yum install mysql-devel, which I've done. I can actually get mysql-python to install properly outside of the virtualenv via yum.
I'm getting the error in the virtualenv only - it uses Python 2.7.9, wheareas 2.6.6 is what comes with Centos.
Also, with MySQL-python installed via yum it will import to the OS's python interpreter, but will not import into the virtualenv's python interpreter.
To clarify, I only installed mysql-python via yum to see whether or not it would work that way. I would prefer it be by pip, in the environment only.
What am I missing here? As far as I'm aware it should work - considering it will work outside of virtualenv.
Found the solution!
I think it was improper of my to install mysql-devel in the first place, so I went ahead and uninstalled it.
Instead, I used a packaged supplied by Percona - Percona-Server-devel-55
yum install Percona-Server-devel-55 and the problem is solved!

Bad Interpreter: No such file or directory error when launching iPython with Anaconda

My ipython was working fine until I installed a new IDE and accidentally changed some path settings. Now, when I try to launch ipython from terminal I get:
-bash: /Users/JohnSmith/anaconda/bin/ipython: /Users/JohnSmith/anaconda/python.app/Contents/MacOS/python: bad interpreter: No such file or directory
How do I change my path/local environment settings back so that it works?
It seems that uninstalling and re-installing Anaconda was the easiest solution (after several hours of playing around with my PATH variables, etc).
This github thread shows the solution from spyder dev ccordoba12:
https://github.com/spyder-ide/spyder/issues/9951#issuecomment-517913824
run
conda install -f python.app
(Very fast to run)
Then spyder etc. was fixed. Apparently an incorrect python path in the launch script.
FYI I had this same issue with Anaconda install with python 3.8 (2022), after a big mess with upgrading anaconda via conda update --all. On MacBook Pro (Intel)