In Python, how can you load YAML mappings as OrderedDicts?

I'd like to get PyYAML's loader to load mappings (and ordered mappings) into the Python 2.7+ OrderedDict type, instead of the vanilla dict and the list of pairs it currently uses. What's the best...

Cant find module Django while deploying on Elastic Beanstalk

I am trying to deploy the backend of this repository https://github.com/LaunchKit/LaunchKit on Elastic Beanstalk. I am very new to Django and I successfully did those two tutorials explaining how...

Flask python app crashes on heroku

I tried pushing my code directly to Heroku for hosting but I got so many errors. Now, what I did was host the code on Github, and then link the git repo with Heroku. Now, the Heroku app was...

Loading special characters with PyYaml

I'm working on loading a list of emoji characters in a simple python 3.6 script. The YAML structure is essentially as follows: - 🙂 - 😁 - 😬 My python script looks like this: import...

running librosa & numba on raspberry pi 3

I am trying to run librosa on my raspberry pi 3. After hours of searching through the internet I was finally able to install it but it still throws an error when I try to import it. First, I had...

How can mypy ignore a single line in a source file?

I'm using mypy in my python project for type checking. I'm also using PyYAML for reading and writing the project configuration files. Unfortunately, when using the recommended import mechanism...

Skip converting entities while loading a yaml string (using PyYAML)

Is there a nice way to prevent the conversion of entities to python objects while loading a YAML string the yaml package? Particularily, I do not want the conversion of timestamp-strings to...

ImportError phonenumbers with google cloud dataflow python

I am trying to do a relatively simple import of the module phonenumbers in Python. I have tested the module on a seperate python file without any other imports and it works completely fine. These...

pip3 install PyYAML failed.(python3.7, macOS High Sierra)

Today I've upgraded python3.7 with brew upgrade command. And I've tried to install PyYAML package with pip3. I've got this error and have no idea.. % pip3 install PyYAML checking if libyaml...

ERROR: Failure: ModuleNotFoundError (No module named 'atoms')

I'm trying to run some tests from the github - https://github.com/freude/NanoNet using git.bash - but when I run the nosetests I run into an ERROR: Failure: ModuleNotFoundError (No module named...

Deploying a new VM using Packstack and Ansible

I have installed Packstack and Ansible 2.7.5 and I would like to make a test and deploy a VM using Ansible. I am using the following code: --- #Deploy an instance - name: Deploy an instance ...

rasa_nlu Failed building wheel for spacy and Failed building wheel for thinc

conda 4.5.8 Python 3.6.0 Operating system: Win10 According to the rasa_core installation documentation, I have successfully installed rasa_core(pip install rasa_core) and rasa_nlu(pip install...

Jupyter-notebook exploding after command conda install -c conda-forge

I hope this post brings you well. I have environment issues that I would love to get assistance on. I installed geopandas with command: conda install -c conda-forge geopandas Then typed...

Graphene - SqlAlchemy - Abstract Attribute

I'm migrating to dock a slightly old python application, not maintained.... I made a pip freeze to see what's going into production. I am confronted with a problem that I have difficulty solving....

django-rest-framework: Unknown command: 'generateschema'

Executed the command according to the documentation: python.exe manage.py generateschema > schema.yml But instead of YAML got an error: Unknown command: 'generateschema' Type 'manage.py help'...

Unable to install pytorch in conda due to setuptools is a dependency of conda and cannot be removed

conda install pytorch torchvision cudatoolkit=9.0 -c pytorch Here is the error I encountered RemoveError: 'setuptools' is a dependency of conda and cannot be removed from conda's operating...

Mypy catch AttributeError

have been using the following code import yaml try: filterwarnings(yaml.YAMLLoadWarning) except AttributeError: pass But when I tried to run mypy today I got "module has no attribute...

Yocto Warrior Bitbake Recipe for PyTorch for NVIDIA Jetson Nano

I am trying to create a simple Yocto Python Recipe for Python 3 PyTorch. The target is an SD Card Image for the NVIDIA Jetson Nano produced by Yocto from the meta-tegra layer. I can successfully...

beam.io.ReadFromPubSub - ImportError: No module named iam.v1

I have a simple beam pipeline in which I am reading data from pub sub and writing to a file. I am running it on direct runner, the code is as follows: pubsub_data = ( p ...

Keras code not working in Jupyter: "The kernel appears to have died. It will restart automatically."

I am writing code in Keras for a simple deep learning based 30x30 cat image classifier. When I get to the portion of my code that is supposed to train the model, Jupyter stops running and gives...

Python pre-commit unittest skipped

I would like to use pre-commit to handle git hooks for my git project. However, when I use it, the git commit command keeps to skip the unittest execution: (smartexchange) trnbook:SmartExchange...

Setting non string variable using PyYaml

I am using mkdocs system which is configured using yaml file, parsed via PyYml. I want to be able to specificy environment variable in its mkdocs.yml which is not possible in mkdocs ecosystem, but...

pre-commit run unittest git hooks: ModuleNotFoundError for installed python module in environment

I use pre-commit to handle git hooks for my git project. When I use it, the pre-commit run -a command keeps to skip the test execution: (smartexchange) trnbook:smartexchange ale$ pre-commit run...

AttributeError: module 'google.cloud.vision' has no attribute 'types'

I did the setup for using the Google Vision API via Python, but it doesn't work and I don't find any good solutions. No matter what I do, I always get "AttributeError: module 'google.cloud.vision'...

Deploying EKS cluster using python boto3

I already have a .py file. While I deploy the .py file, eks clusters and node groups will get created. While running the following python script I am getting the following error : OSError:...

Display a list from Python as flow style inside a block style yaml file (ruamel.yaml)

I am using ruamel.yaml to create a YAML file from a Python dictionary. Within the dictionary, there's a list as the value for the 'type' key. I've been looking all day now for examples to solve my...

How to create a requirements.txt file in Django project?

I have been trying to create a requirements.txt file from the Pycharm terminal but it is adding all unnecessary packages as well. What should I do to show only used...

Bokeh/panel won't render in-line with Jupyter Lab

I'm trying to visualize Bokeh plots and panels with a Bokeh backend in a notebook in JupyterLab. Things were running fine until I updated. Current packages and versions are below I have tried the...

How to fix strict error when loading RoBerta using PyTorch

Any tips on how to fix this? Trying to follow the basic torch guide here: https://pytorch.org/hub/pytorch_fairseq_roberta/ but running into this error: <ipython-input-16-53ecab33b355> in <module> ...

Heroku: Compiled Slug Size is too large Python

I trying to deploy my app to heroku I have following deploying error transformers 4.8.2 requires huggingface-hub==0.0.12, but you'll have huggingface-hub 0.0.14 which is incompatible. ...