Deploy Django app on heroku. Who has suceeded? - django

When I launch command line:
$ pip install -r requirements.txt
The following error shows:
command 'gcc-4.0' failed with exit status 1
Why? Thanks!

If not already done, installing gcc >= 4.0 on your system might help.

Are you trying to install the requirements manually? That automatically happens when you deploy to Heroku, as long as you have a requirements.txt file in the root of the repo.

I had this same problem. The issue was that pip was looking for gcc in the /Developer folder, which does not exist on my system. I ended up creating the folder that pip was looking for (/Developer/usr/bin) and adding a symbolic link to /usr/bin/gcc in this new folder. The command to do this is ln -s /usr/bin/gcc gcc. In your case, you can replace gcc with gcc-4.0. I hope this helps.
You can find some more information here: gcc-4.2 error when using pip in virtualenv on OSX 10.7.

Related

Vmware on Arch: Could not open /dev/vmmon: No such file or directory

I want to install VMware Workstation on Arch. I used the command yay -S vmware-workstation to install. After installation finished, I ran VMware, created an VM, started it, and got the error:
Could not open /dev/vmmon: No such file or directory.
Please make sure that the kernel module `vmmon' is loaded.
I tried to install linux-header but it still didn't work.
OS: Arch Linux, 5.10.56-1-lts.
Thanks for any help!
I ran into this problem too, and the solutions I found online ended up having their own problems that needed to be solve, which I'll document here.
To solve the error Could not open /dev/vmmon/: you need to run:
sudo vmware-mod-config --console --install-all
If this returns an error about Glib not having support, you need to clone https://github.com/mkubecek/vmware-host-modules.git and make it.
$ git clone https://github.com/mkubecek/vmware-host-modules.git
$ cd vmware-host-modules
$ git checkout -b 16.2.1 origin/workstation-16.2.1
$ sudo make
If this returns an error containing fatal error: generated/autoconf.h: No such file or directory, you need to install linux-headers and make sure it matches your linux kernel version. Probably also make sure your kernel is up to date, although I'm not sure if that's necessary.
$ sudo pacman -S linux
$ sudo reboot
$ sudo pacman -S linux-headers
Now you should be able to make install in that cloned repo, which should install the required modules for you to be able to run the vmware-mod-config --console --install-all command, which should solve the issue.
So working backwards, the steps are:
Update your linux kernel and install the right linux-headers for it.
Clone this git repo, cd into it, git checkout -b 16.2.1 origin/workstation-16.2.1, and run sudo make install
Run sudo vmware-mod-config --console --install-all
More about can be found at my post here: https://bbs.archlinux.org/viewtopic.php?pid=2020372#p2020372
I also encountered same problem. Most of the stackoverflow pages suggest to reinstall the vmware but its not a fair solution and even its not a solution. Its just like if you have pain in teeth remove that teeth.
Another thing is that some post and even vmware official posts said to disable secure boot.
But after trying both nothing changed so i goto to cd /dev and found that the file vmmmon exists.
And when i tries to load the file it loaded successfully.
So from here i concluded that to solve this issue do the following:
Either disable the secure boot or sign the vmmon.
CD to /dev/
Load vmmon using modprobe
and as always Happy coding....
The command: sudo vmware-modconfig --console --install-all works, but every time that I reboot the system the error come out again.
In my case, the cause of this problem was the vmmon didn't be load. So I just
sudo modprobe -v vmmon
and it work.

Problem with missing Distutils folder after upgrading from Ubuntu 19.10 to 20.04

I'm having an issue with virtualenv, and virtualenvwrapper after upgrading from 19.10 to 20.04.
I had a fully functional Django application in my Dev environment on Ubuntu 19.10, but since updating to 20.04 my virtualenv isn't working correct.
Specifically it says that:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/python3.7/distutils/__init__.py
I've checked the path, and the distutils folder is missing, but I'm not sure how I go about fixing this.
There is a disutils folder in /usr/lib/python3.8, but when I copy that across to my python3.7 folder, I just get a different error.
The easiest way to fix this is to rebuild your virtualenv:
$ VENV=~/.virtualenvs/myvirtualenv
$ rm -r $VENV
$ python3 -m venv $VENV
$ . $VENV/bin/activate
$ pip3 install -r requirements.txt
This will remove your old virtualenv and create a new one based on the packages specified in requirements.txt.

AWS Linux Server install R package

I try to install the package "data.table" (and "aws.s3)" via Rstudio Server on an Amazon Linux instance following this guide:
http://stanke.co/category/r/
Unfortunately, I get the following error message. I really don't know what else to do.
Can anybody help? I installed devtools and I am able to install other packages such as xml2, devtools and deplyr.
I had the same issue on AWS and already fixed.
You need first install gcc64 and openmp shared support library.
sudo yum install gcc64
sudo yum install libgomp
Then under your user home create an .R folder with a Makevars file in it, with the following content (it will tell to R which compiler to use):
CC = /usr/bin/gcc64
CXX = /usr/bin/g++
SHLIB_OPENMP_CFLAGS = -fopenmp
I hope it's working for you as well ...
You need to install dmlc-core.
This link will provide more information:
A common bricks library for building scalable and portable distributed machine learning
based on https://github.com/RcppCore/RcppArmadillo/issues/200, I think this issue is due to a g++ compatability issue. It might also explain why when I installed devtools it kept giving me [-Wdeprecated-declarations]
so run:
sudo yum remove gcc72-c++.x86_64 libgcc72.x86_64
yum install R-devel
Then you should be able to run the installation command.

AWS cli installation on Mac with anaconda python

I am installing aws cli on Mac. Previously I installed anaconda to control my python versions. So I installed python using conda. Now I want to install aws cli.
By using pip:
pip3 install awscli --upgrade --user
The installation was successful. However, when I run
aws --version
It told me that aws command was not found.
I again tried to add it to the command line path. But I could not find where it was installed.
When I run
which python
It gave me
/anaconda/bin/python
People say this might not be the real folder and it is true I could not find aws cli under it either.
I then run
ls -al /anaconda/bin/python
It gives
lrwxr-xr-x 1 mac staff 9 Aug 15 20:14 /anaconda/bin/python -> python3.6
I dont understand the path at all.
How could I find where my aws cli installed?
I ran into the same issue and eventually found the awscli command in ~/.local/bin. Just add /Users/<username>/.local/bin to your $PATH.
You can do this by editing ~/.bash_profile, which probably already has these lines in it:
# added by Anaconda3 4.4.0 installer
export PATH="/Users/<username>/anaconda/bin:$PATH"
You could make another copy of this line but replace the anaconda path with the new one, but I just updated the existing path since the two are related:
# added by Anaconda3 4.4.0 installer
export PATH="/Users/<username>/.local/bin:/Users/<username>/anaconda/bin:$PATH"
I solved the problem by using conda to install awscli.
conda install -c conda-forge awscli
worked so far. It seems that pip install does not work for conda installed python... Is this conclusion true?
If it's installing and then saying "command not found" it probably just means that the executable it has installed is not referenced in the operating systems PATH environment variable.
Here is how to add the downloaded executable to PATH: https://docs.aws.amazon.com/cli/latest/userguide/cli-install-macos.html#awscli-install-osx-path
Here is the AWS docs to troubleshoot the issue: https://docs.aws.amazon.com/cli/latest/userguide/troubleshooting.html
I encountered an identical situation.
I solved this by adding the location of the awscli command to the file...
/etc/paths
The location to my awscli command was where others had found it...
~/.local/bin
From my home directory in Mac OS X Terminal, I entered a quick nano command to edit the /etc/paths file...
sudo nano /etc/paths
#For those who don't know...
#sudo is to get admin access
#nano is quick and dirty file editor.
# /etc/paths is the file you want to edit.
I entered my password, then I just added the awscli command location at the end of the file...
/Users/UpAndAtThem/.local/bin
Yours might be be...
/Users/your_username_here/.local/bin
Still in Nano editor to exit and save: Hit control+X > Hit Y > Hit Enter.
Here's a quick video...
https://youtu.be/htb_HTwtgmk
Good luck!

pip not working on windows python 2.7.9

I've installed Python 2.7.9, which comes with already bundled with pip. I've check that it's there in the modules list.
But when I run pip install
I get
SyntaxError: invalid syntax
With install highlighted as the error?
What am I doing wrong?
Seems like you are running pip install from Python interactive console. Instead, you should run it from Windows console (cmd or PowerShell):
python2.exe -m pip install <package_name>
Where python2.exe is executable for Python2.7.9 (you may need to include full path to the executable file) and <package_name> is the name of package you want to install
Append C:\Python27\Scripts;in PATH variable
where C:\Python27\Scripts; is the path where pip script is located.
I faced the same issue and got to know that the error is because it is not able to find the pip.exe to execute.
You need to check the path : C:\Python27\Scripts
There, you will find the .exe file and if you run the command from that folder, the command should not give you the error or while running the command, please provide entire path instead of just pip command.
just put python before pip
python pip install <package_name>
To install try the following command:
python.exe -m install web.py
what i would suggest is navigate to the location where pip is located and try with the following command :
Pip install
enter image description here
Probably you want to install Python Modules? I really did many tries, So Finally reached on point to install Python3.6. It offers most easiest way to install it's modules, Try this way
https://stackoverflow.com/a/46652413/8145641
Soon's anwser worked for me, with slight difference, without 2 after python:
python.exe -m pip install <package_name>
What I don't understand, is that this should be equal to the command in interactive console as following, isn't it ?
pip -m install <pachage_name>