What does "Skipping virtualenv creation, as specified in config file." mean? - python-poetry

When I run poetry commands, I get the message:
Skipping virtualenv creation, as specified in config file.
I don't remember setting such a thing, and I don't really see anything relevant in the pyproject.toml. What config file is poetry talking about?

You can see current settings via poetry config --list. These settings are usually global settings. But it's also possible to have local settings due to a poetry.toml in the same folder as the pyproject.toml. Local configs can be set by a poetry config --local <configsetting>.
This is also described in the docs: https://python-poetry.org/docs/configuration/
A poetry config virtualenvs.create true is what you are looking for. This setting is the default value. So there is a good chance that you've changed it at some point.

Related

ruby bundler default config values

How can I get the default values that bundle uses for various unconfigured variables? If I try
bundle config get disable_shared_gems
You have not configured a value for `disable_shared_gems`
Yet I'm sure bundler has some idea of what to do about shared gems, since it keeps trying to install them even though I have versions obtained via apt install ruby-*
All I can see via bundle config get/list is the PATH variable, which I have set in ~/.bundle/config. If I don't set PATH, it uses my sudo capabilities without asking and "helpfully" installs to some system directories.

Could not find conda environment

I am trying to re-enter my conda environment but I am having trouble doing so as when I type conda activate (evironment name) or source activate (environment name) both return the error 'Could not find conda environment.' This is very strange as when I type conda info --envs, I get this:
# conda environments:
#
base * /Users/(my name)/anaconda3
/anaconda3/envs/(environment name)
Names and Prefixes
For a Conda environment to have a name it must be installed in one of the envs_dirs directories (see conda config --show envs_dirs). Creating an environment outside of one of those forfeits its "name-ability". Instead, one must use the path (called its prefix) to activate it, e.g.,
conda activate /anaconda3/envs/my_env
Other commands will require one to use the --prefix|-p flag to specify the environment. See the documentation on "Specifying the location for an environment".
Adding Other Env Locations
If one plans to frequently install in a different location than the default, then there is an option to add directories to the envs_dirs configuration variable. In this specific case, this would be
conda config --append envs_dirs /anaconda3/envs
Note that whatever directory one specifies in this command will become the de facto default for future installs using the --name|-n flag. If one still wants to keep the standard default (/Users/<user>/anaconda3/envs), then they should follow the above with
conda config --prepend envs_dirs /Users/<user>/anaconda3/envs
That is, this will let one pick up the "names" of the environments installed in /anaconda3/envs, but calling conda create -n foo would still create it in /Users/(my name)/anaconda3/envs/foo.
For documentation, see: conda config --describe envs_dirs
Once upon a time I had a similar problem in Windows in Visual Studio Code terminal when I run activate C:\...\myEnvironmentFolder with the message Could not find conda environment: C:... The following command helped me:
source C:/myPath/Anaconda3/etc/profile.d/conda.sh
Then running activate C:\...\myEnvironmentFolder gave the desired effect
If you have the problem like this in cmd console, then, probably, you forgot to set the path in
Control panel -> System -> Advanced system settings -> User / System variables -> Path -> Edit -> New ->
and add
C:\ProgramData\Anaconda3\Scripts
C:\ProgramData\Anaconda3
C:\ProgramData\Anaconda3\Library\bin
You can try using a different method to create a virtual environment, Open CMD and type pip install virtualenvwrapper-win and hit enter this would be your step 1.
Step 2) mkvirtualenv

Is it possible to import dependencies from a CONDA environment.yml into my current environment?

I realise I can create a new environment from a yml with conda env create -f environment.yml (from conda docs).
However in my case, I have an environment already setup with a ton of things installed and setup just the way I like and need it. Now I'd like to install a new package which has a bunch of dependencies. From what I can see there are no conflicts with my current env. Is it possible to somehow import this yml into my current environment? I couldn't find any info on this on the docs or the web (they all point back to creating a new env from the yml).
I realise I can export my current environment as a yml, do a merge with the new yml, and then create a new environment with the merged file, but that seems a bit convoluted for something which I think would be a relatively common request.
I was able to do an environment update like this by following the instructions here:
How to update an existing Conda environment with a .yml file
I did have to deactivate the environment to update the dependencies as per Dave's comment.

Vagrant - PuPHPet. Reset provisions

Let say I provisioned my VM with few php modules and custom packages.
Then I removed modules / packages from config.yaml or exec-always shells.
When running reload or provision its not being removed.
Is it correct behaviour ?
What is correct vagrant command to reset provisions ?
Unfortunately PuPHPet's Puppet code does not currently support ensure flags.
ie you can only ever add packages, never remove them.
The reason is simple. To add a package, you simply add it to the config.yaml file. How would you remove it? Remove it from the config.yaml file? Then Puppet won't know anything about it because it's no longer listed.

Ansible Composer Module Missing?

When I try to use the Ansible's Composer module and paste the following task into my playbook.yml file I get an error.
playbook.yml
- name: Composer Install Site Dependencies
composer: command=install working_dir=/var/www/html
Error:
ERROR: composer is not a legal parameter in an Ansible task or handler
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
After some investigation I ran "anisble-doc --list" on the command line to see the available modules and "composer" is not listed. I am running Ansible version 1.5.4, do I have to add it separately?
As #user272735 indicated in the comments, this is an unreleased module- it's slated for the 1.6 release, which is under "active development". (admittedly it was originally slated for 1.4) You have a couple of options:
install ansible from the bleeding edge. See "running from source". (obviously, this is scary)
ninja-patch the file into your locally installed tree. (obviously, this is scary)
add the file into your local Ansible repo.
As "developing modules" says, a fourth option is to specify your library path via ANSIBLE_LIBRARY or --module-path. HOWEVER, this overrides your global library/module path. That isn't what you want to do unless you are providing every module.
adding into your repo
I'm assuming your repo is named "ansible" and is set up properly, like this:
ansible/
ansible/roles/
ansible/group_vars/
In that case, simply add a library directory at the top (the 'best practices' discusses this but not in the expected section):
ansible/
ansible/roles/
ansible/group_vars/
ansible/library/
Inside there, add the composer file in there. That makes its path/file the following:
ansible/library/composer
Note it is not composer.py or anything else. Also, it doesn't seem to need the +x bit, so no fussy worries there.
Once you do that, you can run Ansible commands as you'd expect. The composer module will simply be there.

Resources