python import a non standard library
Hi I downloaded a cool github to run in jupyter notebook.
however I need to import this "non standard library" by the author
- downloaded the files
- I put the file in the same folder, made sure that my notebook is pointing there.
- type "import indicators" in the notebook
(by the way its a file called indicators.py in https://github.com/voice32/stock_market_indicators/)
and I get this error
Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagesIPythoncoreinteractiveshell.py", line 2961, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 5, in
import indicators
File "C:Usersney12Google Drive1) Financial Mastery3) paper assets, trading, Other assetsforexVan tharp Forex trading systemNey study of van tharp forex trading systemForex-initial-analysisindicators.py", line 235
val_last = val
^
TabError: inconsistent use of tabs and spaces in indentation
just in case I open the command line and type "pip install indicators.py"
but I get an error:
" Could not find a version that satisfies the requirement indicators.py (from versions: )
No matching distribution found for indicators.py"
help please!
python github jupyter-notebook jupyter
add a comment |
Hi I downloaded a cool github to run in jupyter notebook.
however I need to import this "non standard library" by the author
- downloaded the files
- I put the file in the same folder, made sure that my notebook is pointing there.
- type "import indicators" in the notebook
(by the way its a file called indicators.py in https://github.com/voice32/stock_market_indicators/)
and I get this error
Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagesIPythoncoreinteractiveshell.py", line 2961, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 5, in
import indicators
File "C:Usersney12Google Drive1) Financial Mastery3) paper assets, trading, Other assetsforexVan tharp Forex trading systemNey study of van tharp forex trading systemForex-initial-analysisindicators.py", line 235
val_last = val
^
TabError: inconsistent use of tabs and spaces in indentation
just in case I open the command line and type "pip install indicators.py"
but I get an error:
" Could not find a version that satisfies the requirement indicators.py (from versions: )
No matching distribution found for indicators.py"
help please!
python github jupyter-notebook jupyter
add a comment |
Hi I downloaded a cool github to run in jupyter notebook.
however I need to import this "non standard library" by the author
- downloaded the files
- I put the file in the same folder, made sure that my notebook is pointing there.
- type "import indicators" in the notebook
(by the way its a file called indicators.py in https://github.com/voice32/stock_market_indicators/)
and I get this error
Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagesIPythoncoreinteractiveshell.py", line 2961, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 5, in
import indicators
File "C:Usersney12Google Drive1) Financial Mastery3) paper assets, trading, Other assetsforexVan tharp Forex trading systemNey study of van tharp forex trading systemForex-initial-analysisindicators.py", line 235
val_last = val
^
TabError: inconsistent use of tabs and spaces in indentation
just in case I open the command line and type "pip install indicators.py"
but I get an error:
" Could not find a version that satisfies the requirement indicators.py (from versions: )
No matching distribution found for indicators.py"
help please!
python github jupyter-notebook jupyter
Hi I downloaded a cool github to run in jupyter notebook.
however I need to import this "non standard library" by the author
- downloaded the files
- I put the file in the same folder, made sure that my notebook is pointing there.
- type "import indicators" in the notebook
(by the way its a file called indicators.py in https://github.com/voice32/stock_market_indicators/)
and I get this error
Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagesIPythoncoreinteractiveshell.py", line 2961, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 5, in
import indicators
File "C:Usersney12Google Drive1) Financial Mastery3) paper assets, trading, Other assetsforexVan tharp Forex trading systemNey study of van tharp forex trading systemForex-initial-analysisindicators.py", line 235
val_last = val
^
TabError: inconsistent use of tabs and spaces in indentation
just in case I open the command line and type "pip install indicators.py"
but I get an error:
" Could not find a version that satisfies the requirement indicators.py (from versions: )
No matching distribution found for indicators.py"
help please!
python github jupyter-notebook jupyter
python github jupyter-notebook jupyter
edited Nov 21 at 6:08
Julian Peller
849511
849511
asked Nov 21 at 3:04
Ney J Torres
112118
112118
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
The error is in the stacktrace:
TabError: inconsistent use of tabs and spaces in indentation
This happens when someone uses tabs and spaces interchangeably for indentation in a script. Quite frustrating
I'd suggest opening that file in the text editor of your choice and doing a bulk find-and-replace of tabs and replace with spaces. You can do that with the t
char in the find bar (note the escape slash), and then either s{4}
(if regex is enabled) or just hit space 4 times in the replace field. Save it, then re-import it with a fresh python shell
you where right!!!
– Ney J Torres
Nov 21 at 3:16
1
Or you can reindent the entire directory by usingautopep8 package_dir --recursive --select=E101,E121 --in-place
. You need to installautopep8
using pip!
– bro-grammer
Nov 21 at 3:31
1
@bro-grammer that's really cool, never knew you could do that
– C.Nivs
Nov 21 at 3:33
add a comment |
Run autopep8 on the module you downloaded.
i.e.
pip install autopep8
autopep8 --in-place <File.py>
You now should be good to go
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53404707%2fpython-import-a-non-standard-library%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
The error is in the stacktrace:
TabError: inconsistent use of tabs and spaces in indentation
This happens when someone uses tabs and spaces interchangeably for indentation in a script. Quite frustrating
I'd suggest opening that file in the text editor of your choice and doing a bulk find-and-replace of tabs and replace with spaces. You can do that with the t
char in the find bar (note the escape slash), and then either s{4}
(if regex is enabled) or just hit space 4 times in the replace field. Save it, then re-import it with a fresh python shell
you where right!!!
– Ney J Torres
Nov 21 at 3:16
1
Or you can reindent the entire directory by usingautopep8 package_dir --recursive --select=E101,E121 --in-place
. You need to installautopep8
using pip!
– bro-grammer
Nov 21 at 3:31
1
@bro-grammer that's really cool, never knew you could do that
– C.Nivs
Nov 21 at 3:33
add a comment |
The error is in the stacktrace:
TabError: inconsistent use of tabs and spaces in indentation
This happens when someone uses tabs and spaces interchangeably for indentation in a script. Quite frustrating
I'd suggest opening that file in the text editor of your choice and doing a bulk find-and-replace of tabs and replace with spaces. You can do that with the t
char in the find bar (note the escape slash), and then either s{4}
(if regex is enabled) or just hit space 4 times in the replace field. Save it, then re-import it with a fresh python shell
you where right!!!
– Ney J Torres
Nov 21 at 3:16
1
Or you can reindent the entire directory by usingautopep8 package_dir --recursive --select=E101,E121 --in-place
. You need to installautopep8
using pip!
– bro-grammer
Nov 21 at 3:31
1
@bro-grammer that's really cool, never knew you could do that
– C.Nivs
Nov 21 at 3:33
add a comment |
The error is in the stacktrace:
TabError: inconsistent use of tabs and spaces in indentation
This happens when someone uses tabs and spaces interchangeably for indentation in a script. Quite frustrating
I'd suggest opening that file in the text editor of your choice and doing a bulk find-and-replace of tabs and replace with spaces. You can do that with the t
char in the find bar (note the escape slash), and then either s{4}
(if regex is enabled) or just hit space 4 times in the replace field. Save it, then re-import it with a fresh python shell
The error is in the stacktrace:
TabError: inconsistent use of tabs and spaces in indentation
This happens when someone uses tabs and spaces interchangeably for indentation in a script. Quite frustrating
I'd suggest opening that file in the text editor of your choice and doing a bulk find-and-replace of tabs and replace with spaces. You can do that with the t
char in the find bar (note the escape slash), and then either s{4}
(if regex is enabled) or just hit space 4 times in the replace field. Save it, then re-import it with a fresh python shell
answered Nov 21 at 3:09
C.Nivs
1,8271414
1,8271414
you where right!!!
– Ney J Torres
Nov 21 at 3:16
1
Or you can reindent the entire directory by usingautopep8 package_dir --recursive --select=E101,E121 --in-place
. You need to installautopep8
using pip!
– bro-grammer
Nov 21 at 3:31
1
@bro-grammer that's really cool, never knew you could do that
– C.Nivs
Nov 21 at 3:33
add a comment |
you where right!!!
– Ney J Torres
Nov 21 at 3:16
1
Or you can reindent the entire directory by usingautopep8 package_dir --recursive --select=E101,E121 --in-place
. You need to installautopep8
using pip!
– bro-grammer
Nov 21 at 3:31
1
@bro-grammer that's really cool, never knew you could do that
– C.Nivs
Nov 21 at 3:33
you where right!!!
– Ney J Torres
Nov 21 at 3:16
you where right!!!
– Ney J Torres
Nov 21 at 3:16
1
1
Or you can reindent the entire directory by using
autopep8 package_dir --recursive --select=E101,E121 --in-place
. You need to install autopep8
using pip!– bro-grammer
Nov 21 at 3:31
Or you can reindent the entire directory by using
autopep8 package_dir --recursive --select=E101,E121 --in-place
. You need to install autopep8
using pip!– bro-grammer
Nov 21 at 3:31
1
1
@bro-grammer that's really cool, never knew you could do that
– C.Nivs
Nov 21 at 3:33
@bro-grammer that's really cool, never knew you could do that
– C.Nivs
Nov 21 at 3:33
add a comment |
Run autopep8 on the module you downloaded.
i.e.
pip install autopep8
autopep8 --in-place <File.py>
You now should be good to go
add a comment |
Run autopep8 on the module you downloaded.
i.e.
pip install autopep8
autopep8 --in-place <File.py>
You now should be good to go
add a comment |
Run autopep8 on the module you downloaded.
i.e.
pip install autopep8
autopep8 --in-place <File.py>
You now should be good to go
Run autopep8 on the module you downloaded.
i.e.
pip install autopep8
autopep8 --in-place <File.py>
You now should be good to go
answered Nov 21 at 7:18
Tim Seed
1,8911616
1,8911616
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53404707%2fpython-import-a-non-standard-library%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown