Tensorflow(GPU) in sublime text 3 - tensorflow

I tried to install tensorflow and finally got there.
I got an error:
ImportError: libcudnn.Version: cannot open shared object file: No such
file or directory
while I was installing but I could handle it. I think it works fine in terminal.
However, the problem is when I tried to import tensorflow in sublime text, it spits the same error.
ImportError: libcudnn.so.6: cannot open shared object file: No such
file or directory
Cause I changed the build system path to /home/username/.conda/envs/tensorflow/bin, I can't understand why I get this error here.
Is there anyone who can help me?

As it is working from terminal I think everything like cuda, cudnn and GPU drivers are setup properly and the export path is added to the .bashrc (~/.bashrc) file. That's why running from terminal works. As adding the export information to only .bashrc file will make it work on terminal but won't help for other programs like sublime.
So, I suggest, you take the export information from .bashrc file and add it to /etc/environment file. You need to log out from current user and login again so environment variables changes take place. The export information on .bashrc file should look something like this.
export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64\${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

Related

PyInstaller Executable File: ModuleNotFoundError - Pandas

Background: I have a .py script which uses c.10 libraries/dependencies (e.g., pandas numpy json) and the script also relies on a .ini file, which it looks for in the same dir as it is located.I want to add this .py file to Windows Scheduler, but before I can, I must make the file executable.
Issue: I used PyInstaller to create an executable file. I also added -- onefile and -w when creating the .exe file. My issue is that when I attempt to run the main.exe (either by double-clicking or through cmd) I get the following Unhandled exception in script -
Help: I am trying to understand how this is happening, especially as my understanding of PyInstaller is that it would create an executable file, which would inc. everything the script needs to run (Note: I have double checked that the .py contains import pandas etc.
Can someone explain to me how I would troubleshoot this and/or if there are any key steps I may have obviously missed, which might be causing this?
Try using this commandline for compiling your python file, pyinstaller.exe --onefile --noconsole --hidden-import pandas {Your_FILE_NAME}.py

Python wheel installed successfully but unable to import modules

I have a myFunction.pyd file which I have tested to make sure that modules defined internally are accessible.
I then created a wheel file myFunction-1.0-py3-none-any.whl
Finally using cmd prompt I installed the wheel file. I can then also see the following location:
C:\Program Files\Python38\Lib\site-packages\myFunction-1.0.dist-info
However, when I do the following import myFunction as mf it gives error ModuleNotFoundError: No module named 'myFunction'
Only thing I can think of is I didn't do anything with the pyd file that I had generated. Do I need to also move that file to some location?

ImportError: No module named my project (sys.path is correct)

This is kind of embarassing because of how simple and common this problem is but I feel I've checked everything.
WSGI file is located at: /var/www/igfakes/server.wsgi
Apache is complaining that I can't import the module of my project, so I decided to start up a Python shell and see if it's any different - nope.
All the proof is in the following screenshot, I'll walk you through it.
First, see I cannot import my project
Then I import sys and check the path
Note /var/www in the path
Leave python
Check the directory, then confirm my project is in that same directory
My project is exactly where I'm specifying. Any idea what's going on?
I've followed a few different tutorials, all with the same instructions, like this one.

How can I configure mono to use the correct paths to etc/ directory when the prefix directory is relocated?

I have compiled mono 2.10.9 and 3.0.3 on linux and would like to be able to move these installations to a different location without recompiling. The problem I am having is that mono-sgen is unable to find the etc/ directory after relocation. Interestingly, mono using the boehm GC is able to find that directory after relocation. Is there a reason the two executables behave differently?
I have been able to specify the updated library paths using MONO_PATH like this:
export MONO_PATH=${PKG_DIR}/lib/mono/4.0:${PKG_DIR}/lib/mono/3.5:${PKG_DIR}/lib/mono/2.0:${PKG_DIR}/lib/mono/compat-2.0
but I am stuck on getting mono-sgen to find the etc/ directory. The exception I am receiving as a result is:
ConfigurationErrorsException: Error Initializing the configuration system.
If recompiling mono with the new prefix is the easiest solution I will go that route, but hopefully there is something else I can do to get this working. It's nice when you can relocate an entire program with all its dependencies and it still works.
The answer to the question above is:
export MONO_CONFIG=${PKG_DIR}/etc/mono/config
export MONO_CFG_DIR=${PKG_DIR}/etc
However, there are a number of other environment variables you may need to set to get a relocated mono installation fully working. Read on...
I was able to get this working. It turns out there are a number of variables that need to be set to make the relocation work correctly. The following code assumes the mono installation was moved to ${PKG_DIR}. I moved all the fonts I needed to ${PKG_DIR}/etc/fonts so that they would be found if the installation was moved to a different system. Here are the environment variables I used. Some of these may not be necessary:
export LD_LIBRARY_PATH=$PKG_DIR/lib64:$PKG_DIR/lib:$LD_LIBRARY_PATH
export LD_RUN_PATH=$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=$PKG_DIR/lib64/pkgconfig:$PKG_CONFIG_PATH
export MONO_GAC_PREFIX=${PKG_DIR}
export MONO_PATH=${PKG_DIR}/lib/mono/4.0:${PKG_DIR}/lib/mono/3.5:${PKG_DIR}/lib/mono/2.0:${PKG_DIR}/lib/mono/compat-2.0
export MONO_CONFIG=${PKG_DIR}/etc/mono/config
export MONO_CFG_DIR=${PKG_DIR}/etc
export C_INCLUDE_PATH=${PKG_DIR}/include
export ACLOCAL_PATH=${PKG_DIR}/share/aclocal
export FONTCONFIG_PATH=${PKG_DIR}/etc/fonts
export XDG_DATA_HOME=${PKG_DIR}/etc/fonts
export MONO_REGISTRY_PATH=~/.mono/registry

Biopython, PYTHONPATH, problems finding modules

I installed Biopython, but I am unable to get the computer to recognize the modules. For example, I create a text file in Komodo like this:
from Bio.Alphabet import IUPAC
from Bio import Seq
my_prot=Seq.Seq("AGTACACTGGT",IUPAC.protein)
and run it in terminal and receive:
Traceback (most recent call last):
File "bio.py", line 1, in <module>
from Bio.Alphabet import IUPAC
ImportError: No module named Bio.Alphabet
For the record, I can't get modules to import in interactive mode either. The documentation states that I can append the module search path by exporting to an environmental variable called PYTHONPATH (like with PATH), but when I type 'env' into the terminal, I see no environmental variable of the sort. I'm a biologist--not a computer scientist or programmer. Please bear with my naiveté if this sounds like nonsense.
You must find in which directory situated the module that you needs (Bio) and then add the path to the directory to PYTHONPATH.
$ export PYTHONPATH=/usr/local/bio-python/
Instead of /usr/local/bio-python/ you must specify the path that you've found.
To find the module you must use something like:
$ find / -name \*Bio\*
That is just an example. Of course it would be better if you could give some additional information (e.g. where you've installed the module and so on).
Press the start button, right click on my computer, select properties, go to advanced, click environment variables. Then find your path variable, and edit it by adding a semicolon, then your path. For example, if my path variable at the moment is "C:\Program Files\Java\jdk1.7.0_02\bin", I can change it to "C:\Program Files\Java\jdk1.7.0_02\bin;(PUT PATH HERE)"