Installed Django but django-admin is not found - django-admin

I just installed django using pip but when I try to create a new project using django-admin I get "bash: django-admin: command not found".
I tried installing django in a virtualenv but I'm still getting the same error when trying to create a new project.
While I was trying to solve this issue I found this: Installing Django with pip, django-admin not found
The last answer is saying that django-admin may not be on the path. Can anyone explain me please what does this mean?
If I run "find / -name django-admin.py" I get this:
/home/user/.local/bin/django-admin.py
/home/user/.local/lib/python3.5/site-packages/django/bin/django-admin.py
/home/user/django-admin.py
Can anyone give me some help please? Thank you.

You have installed Django using your account instead of sudo
so do the following to resolve this
$ pip3 uninstall django
$ sudo pip3 install django
This is the output
$which django-admin
/usr/local/bin/django-admin

I had the same problem. My "solution" was to call django-admin directly like
/usr/local/bin/django-admin startproject MyProject

I also experienced this error but none of the above works for me.
This is how I got this silly mistake of me. Example,
$ mkdir django_test cd django_test
$ pipenv shell
(django_test)$ django-admin startproject django_test .
zsh:command not found: django-admin
To solve this error: Don't forget to install your django version in your virtual environment first if you are using.
$ mkdir django_test cd django_test
$ pipenv shell
(django_test)$ pipenv install django==3.0.5 # change the version you are using
(django_test)$ django-admin startproject .

Just in case someone is experiencing this issue, you can just install django using apt package manager instead of pip.
I am not sure if this is the best way to do it but it worked for me.
First you need to uninstall the current installation of django. In this case you can run $ python -m pip uninstall Django
Then run $ sudo apt install python3-django
That should fix the issue.

Related

luarocks install fails?

I install torch following
http://torch.ch/docs/getting-started.html
But when I use luarocks to install libs, like itorch, I command
luarocks install itorch
gives
Error: Your user does not have write permissions in
/home/myname/code/torch/install/lib/luarocks/rocks
-- you may want to run as a privileged user or use your local tree with --local.
Then I cmd
sudo luarocks install itorch
gives
sudo: luarocks: command not found
Then I cmd
luarocks
gives
Configuration files:
System: /home/myname/code/torch/install/etc/luarocks/config.lua (ok)
User : /home/myname/.luarocks/config.lua (not found)
Rocks trees in use:
/home/myname/.luarocks
/home/myname/code/torch/install
So is it installed successfully ?
The first error message explains the problem: your user doesn't have write permission to the directory where you installed Torch. This is probably because you ran something as root that you shouldn't have.
You can probably fix this by running something like:
sudo chown -R myname: /home/myname/code/torch/install/lib/luarocks
sudo chmod -R u+w /home/myname/code/torch/install/lib/luarocks

unable to connect to chromedriver http://127.0.0.1:9515 (Selenium::WebDriver::Error::WebDriverError)

I have installed chrome-driver from http://chromedriver.storage.googleapis.com/index.html
and I have installed both Google-chrome browser also.
I want to Run cucumber test cases using chrome browser instead of Firefox browser but I am stuck with this error.
Any help appreciated.
Thanks
I had this issue because of path override with rbenv shim.
It's worth checking where which chromedriver points too.
For me the fix was:
gem uninstall chromedriver-helper and brew install chromedriver
If you using rbenv on linux machine then
copy 'chromedriver' to current using ruby versions like below -
cp chromedriver $HOME/.rbenv/versions/2.2.0/bin
Example: cp chromedriver home/abc_user/.rbenv/versions/2.2.0/bin
and then set the permissions like -
chmod +x home/abc_user/.rbenv/versions/2.2.0/bin/chromedriver
Open Terminal:
brew link --overwrite chromedriver
I have encountered after installation of ansicon1.60 for colourful screen. After uninstalling it by the following command in ansicon directory:
C:\Users\Administrator\Downloads\x64>ansicon.exe -i
after that, i decided not to use ansicon.
If you have rbenv concerns problem, you may try:
$ rbenv rehash
and then run your test again. ;)
ChromeDriver setup in Linux [Ubuntu]
Open Terminal and download Chromedriver using the cmd
$ wget http://chromedriver.storage.googleapis.com/2.7/chromedriver_linux64.zip
$ Unzip chromedriver_linux64.zip
$ cp chromedriver /usr/local/bin
$ chmod +x /usr/local/bin/chromedriver
Do not use ansicon1.60 for colourful screen.
Run cmd /d which starts the command prompt without processing its AutoRun entry, thus bypassing ANSICON. Then you should just be able to do \x64\ansicon -u.

libMagickCore.so.4: cannot open shared object file: No such file or directory

I am facing is issue in my rails 3.2.17 application. I have install rmagick 2.13.2 ImageMagick 6.7.7-10 in my ubuntu machine. I did locate libMagick and I found the below list:
$ locate libMagick
/usr/lib/x86_64-linux-gnu/libMagickCore.a
/usr/lib/x86_64-linux-gnu/libMagickCore.la
/usr/lib/x86_64-linux-gnu/libMagickCore.so
/usr/lib/x86_64-linux-gnu/libMagickCore.so.5
/usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0
/usr/lib/x86_64-linux-gnu/libMagickWand.a
/usr/lib/x86_64-linux-gnu/libMagickWand.la
/usr/lib/x86_64-linux-gnu/libMagickWand.so
/usr/lib/x86_64-linux-gnu/libMagickWand.so.5
/usr/lib/x86_64-linux-gnu/libMagickWand.so.5.0.0
RMagick2.so is depends on libMagickCore.so.4, but you don't have it.
For workaround try this:
sudo ln -s /usr/lib/x86_64-linux-gnu/libMagickCore.so.5 /usr/lib/x86_64-linux-gnu/libMagickCore.so.4
sudo ln -s /usr/lib/x86_64-linux-gnu/libMagickWand.so.5 /usr/lib/x86_64-linux-gnu/libMagickWand.so.4
sudo ldconfig
If this does not work, probably, you need earlier version of ImageMagick.
Finally I could find the solution. Hope this may help others also. Actually "libmagickcore4" libs was missing. So install it using below command.
sudo apt-get install libmagickcore4

Error setting up the tesseract OCR in gem in rails

I'm trying to setup the tesseract-ocr gem in my rails environment. I have ran brew install tesseract and then ran a bundle install on the app and that all runs without errors however when starting the app (rails s) the following error is throw:
/Users/xxxx/.rvm/gems/ruby-1.9.2-p290#xxxx/gems/ffi-inline-0.0.4.3/lib/ffi/inline/compilers/gcc.rb:35:in `compile': compile error: see logs at /var/folders/66/pm_j0lp94gvcj0qnlcnsx9pw0000gn/T/.ffi-inline-501/4239dac38f2a721e0dc5b3750d71ce2e6fa4acb6.log (CompilationError)
It reference the following log file:
g++ -dynamic -bundle -fPIC -L/usr/local/Cellar/tesseract/3.02.02/lib -I/usr/local/Cellar/tesseract/3.02.02/include -o /var/folders/66/pm_j0lp94gvcj0qnlcnsx9pw0000gn/T/.ffi-inline-501/4239dac38f2a721e0dc5b3750d71ce2e6fa4acb6.dylib /var/folders/66/pm_j0lp94gvcj0qnlcnsx9pw0000gn/T/.ffi-inline-501/4239dac38f2a721e0dc5b3750d71ce2e6fa4acb6.cpp -llept 2>>/var/folders/66/pm_j0lp94gvcj0qnlcnsx9pw0000gn/T/.ffi-inline-501/4239dac38f2a721e0dc5b3750d71ce2e6fa4acb6.log
/var/folders/66/pm_j0lp94gvcj0qnlcnsx9pw0000gn/T/.ffi-inline-501/4239dac38f2a721e0dc5b3750d71ce2e6fa4acb6.cpp:1:10: fatal error: 'leptonica/allheaders.h' file not found
#include <leptonica/allheaders.h>
I followed these two issues:
https://github.com/meh/ruby-tesseract-ocr/issues/3 and https://github.com/meh/ruby-tesseract-ocr/issues/21
It talks about setting ENV vars which i have done. I created a test.rb file in the initalizers folder with the following vars set:
ENV['CFLAGS'] = '-I/usr/local/Cellar/tesseract/3.02.02/include'
ENV['LDFLAGS'] = '-L/usr/local/Cellar/tesseract/3.02.02/lib'
However this makes no difference to the error when starting the app.
I don't understand what it means when it says update the headers. I was wondering if someone could tell me exactly what to do to get this working.
Thanks.
Also had the same error. I solved it by installing the dev packages for tesseract and leptonica.
For debian based systems
sudo apt-get install libleptonica-dev libtesseract-dev
For redhat base systems
sudo yum insall leptonica-devel tesseract-devel
That solved the problem for me.
I've fixed this...
Just in case anyone else has a problem here's exactly how it was fixed in mine:
Firstly had to run both:
brew install tesseract
and
brew install leptonica
Then in the Gemfile NOT in an initializer you have to put both paths to the libraries as env vars:
ENV['CFLAGS'] = '-I/usr/local/Cellar/tesseract/3.02.02/include -I/usr/local/Cellar/leptonica/1.69/include'
ENV['LDFLAGS'] = '-L/usr/local/Cellar/tesseract/3.02.02/lib -L/usr/local/Cellar/leptonica/1.69/lib'
Had this issue (OS X El Capitan). Fixed by downgrading tesseract with
brew uninstall --force tesseract
brew install https://raw.githubusercontent.com/Homebrew/homebrew/8ba134eda537d2cee7daa7ebdd9f728389d9c53e/Library/Formula/tesseract.rb
and updating xcode
xcode-select --install

Yeoman is installed but no output is seen when attempt is made to run angular generator

No error appears when I run
yo angular appname
I have already installed yeoman and I am using ubuntu 12.10
Reinstall the yeoman
sudo npm install -g yo
Watch out for the last part of your installation.
Notice that for my output,
/usr/bin/yo -> /usr/lib/node_modules/yo/bin/yo
My solution is
sudo nano ~/.bash_profile
Inside the ~/.bash_profile
export PATH=/usr/bin:/usr/lib/node_modules:$PATH
Basically add the paths where yo belongs to
Then execute the .bash_profile
. ~/.bash_profile
Now you can run the yo angular appname
If you have updated nodejs to latest version (Mine is v0.10.33)
Open /usr/lib/node_modules/yo/cli.js
and update #!/usr/bin/env node to #!/usr/bin/env nodejs

Resources