This question already has answers here:
Change Package directory in Julia
(2 answers)
Closed 6 years ago.
How can I change the path of the package directory in Julia? I not found answer in documentation from section Package Manager Functions.
I use Julia v0.4.6 on Windows.
Option 1
How about this command from the documentation:
push!(LOAD_PATH, "C:\Path\To\My\Module\")
Which can be run from within Julia, or, as the docs say:
Putting this statement in the file ~/.juliarc.jl will extend LOAD_PATH on every Julia startup. Alternatively, the module load path can be extended by defining the environment variable JULIA_LOAD_PATH.
Option 2
The SET command in windows should be equivalent to export in unix/linux based systems: Windows equivalent of $export. E.g.
SET JULIA_PKGDIR=C:\your\directory
From here, this should enable one to follow the answer from #Gnimuc: Change Package directory in Julia
Related
This question already has answers here:
How do I configure a startup/config script for Powershell?
(2 answers)
Closed 2 years ago.
I have a couple of Windows 10 Powershell commands that I always enter at the start of a terminal session (to do key bindings to enable using up arrow to auto-complete a command from my command history). I made a shell script to do this, but is there a way to make it run automatically when I start the Powershell?
More details that may be relevant:
I am actually using the Anaconda Powershell (which I understand to be just a Windows Powershell).
The two commands are: Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward
I currently have them in a script called init.ps1 that I can run when I start the Powershell (obviously, by typing init.ps1 ).
##############################
EDIT: Thank you for the response. Someone pointed out that there was a similar question posted:
How do I configure a startup/config script for Powershell?
Between these answers, I was able to set up a configuration script by creating a directory, C:\Users\(user)\Documents\WindowsPowerShell and placing a script called Microsoft.PowerShell_profile.ps1.
I think you would like to create a profile, and Microsoft's documentation has information on which type of profile, and other information at the following webpage,
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-7.1&viewFallbackFrom=powershell-7.
I have OSX El Captain with installed Python3.5 and Python2.7.
I have a folder with my python script and functions which I already added to the environment variable PATH and somehow[*] also to sys.path:
Project_folder/
- Python/
-- __init__.py
-- batchProc.py (written in Python 3.4)
-- (other python files)
I set my PATH with a .bash_profile file:
PATH=“/Users/Robyc/Project_folder/Python:${PATH}”
export PATH
And the folder it's there:
echo $PATH
“/Users/Robyc/Project_Folder/Python:/Library/Frameworks/Python.framework/Versions/3.5/bin:/opt/local/bin:/opt/local/sbin:/usr/local/mysql/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin”
My sys.path variable
['/Applications/PyCharm CE.app/Contents/helpers/pydev', '/Applications/PyCharm CE.app/Contents/helpers/pydev', '/Library/Frameworks/Python.framework/Versions/3.5/lib/python35.zip', '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5', '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/plat-darwin', '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/lib-dynload', '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages', '/Users/Robyc/Project_Folder/Python', '/Users/Robyc/Project_Folder/']
I have two problems which I have the feeling that are linked to each other.
if I type bacthProc.py in the terminal I get Command not found. I need to go to ~/Project_folder/Python
if I run ~/Project_folder/Python/batchProc.py the code starts but I get ImportError: No module named Python.
I really don't understand what's wrong with my configuration.
[*] my ~/Project_folder was already there before, but I don't remember how I added it...
My PYTHONPATH is empty. I now used a pth file as suggested in the
documentation to add my ~/Project_folder/Python folder to the
sys.path, i.e. I created the following file:
/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/svn_code.pth
which contains:
/Users/Robyc/Project_folder/Python/
For the sake of completeness I share the solution to the problem.
The problem was, as expected, in the PATH variable:
the text editor (TextEdit.app) I used to modify the .bash_profile modified the quotation marks ("...") in a way not correctly recognized by the shell.
This can be actually seen in the path I posted in the question above: the quotation marks shouldn't appear when doing echo $PATH in the terminal.
As a result the PATH variable was not properly set. That's why it wasn't possible to call python anymore.
Solution: open the bash_profile with nano and modify the quotation marks...
and never use again TextEdit to modify the bash_profile
This question already has answers here:
How to set an alias inside a bash shell script so that is it visible from the outside? [duplicate]
(4 answers)
How to reload .bashrc settings without logging out and back in again?
(18 answers)
Closed 6 years ago.
So I have added an alias for jumping to another directory like this
in my ./bashrc file , Looks like this
alias crmx="cd /var/www/crm/website-crm/"
Then i saved the file
but when I try to run
crmx
it says
command not found
Also I tried to do alias to see all the command but my command is not listed
Any idea ?
The file is ~/.bashrc (starting with a dot).
And you have to source it (reload) by doing source ~/.bashrc or just by closing and reopening your terminal.
You can also type ps to check if your shell is bash (for example if it's zsh you have put your alias in the ~/.zshrc file)
Let's suppose you are on bash.
Once you saved that file, you have to have bash read it with a command like this:
. ~/myaliasfile
or like this
source ~/myaliasfile
if the file resides in your home directory. Specify the path (relative to your home or absolute) otherwise.
Then you'd go to your .bashrc file and add the very same line to the end of it. By doing so the alias(es) will be read and made available to every single bash invocation and login.
Done!
More details here and here.
This question already has answers here:
Why can't I change directories using "cd" in a script?
(33 answers)
Closed 7 years ago.
I'm creating a shell script that will allow a back functionality on my shell. What would be a good way to change the terminal's directory in the script.
Just running something like this in my back.sh file doesn't work:
cd /
Even when I run the file like
source ./back.sh
A sample file that is not working properly:
#!/bin/bash
cd ~/Movies/
when I run source ./back.sh or source back.sh
Here are my 2 cents about the difference between . and source builtins: There isn't any.
Since you mentioned that you use . for cd ../, make sure that the proper . and source are executed and are really the same thing:
user#host> type source
source is a shell builtin
user#host> type .
. is a shell builtin
Other than that /bin/bash --version may turn out helpful, too.
This question already has an answer here:
How to restore .bash_profile on a mac? None of my unix terminal are working [closed]
(1 answer)
Closed 6 years ago.
Hi guys I tried to add new directory to the PATH, but instead appending I overwrote it. Is there any way to restore those default paths?
If you changed your PATH in a Terminal shell, simply close that Terminal window and open a new one. Changes to environment variables are local to the shell in which you change them (and any subshells created by that one).
Just restart your terminal that will assign variables based on your .profile or .bashrc ( if you are running bash )